router: Fix bugs in the HTTP backend.

Signed-off-by: Blaž Hrastnik <blaz.hrast@gmail.com>