Make it possible to test http headers

This can be used to check that we have redirected to the error page,
for example.

Change-Id: I9947b435dac5d5ef82f465dc398050cc8f29ae14