Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way (Firefox add-on or about:config setting) to send a custom HTTP header for requests to a certain host?

Example: Send the header Foobar: true if (and only if) I request a resource from the host

Bonus points if the protocol can be specified, too (e.g. only send the header when requesting over HTTPS).

(see my question Use additional “password” in Referer to hide private site? on IT Security SE on why I’d like to do it)

What I found so far

share|improve this question

If you are not restricted with Firefox, you can use Google Chrome's extension Header Hacker.

It provides:

  1. custom request headers (you're able either add new headers or override existing ones)
  2. permanent headers for specified hosts (you're able either add new headers or override existing ones)

So that you can solve your problem with second feature.

I'm using the extension a lot and it works fine for me.

share|improve this answer
Thanks. I’m restricted to Firefox, but your answer might of course be helpful for others. :) – unor Aug 22 '13 at 16:13
The link is broken – Taha Jahangir Sep 9 '14 at 8:10
@TahaJahangir the extension's maintainer have changed the name of the app recently. I have updated the broken link. And yes, the extensions is really helpful -- I'm using it on daily basis – ajukraine Sep 16 '14 at 13:23

The Firefox add-on, Header Tool, does what you are looking for:

I just tried it out to restrict my custom request header to localhost.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .