didierfred / SimpleModifyHeaders

Extension for firefox and chrome to modify headers
164 stars 30 forks source link

Firefox does not add/modify response headers #19

Closed nalply closed 4 years ago

nalply commented 4 years ago

I configured X-Test-Request and X-Test-Response for request and response headers respectively.

image

Result: X-Test-Request is set, but X-Test-Response is not.

image

Version: Firefox Developer Edition 77.0b4 (64-bit) MacOS High Sierra 10.13.6

image

didierfred commented 4 years ago

It modify the header but unfortunately you can't see it in the console . It seems firefox log the header before it is modified by the plugin . If you add a header "content-type" with value "text/plain" for all pages , you will see that the response header is modified since all page will be shown as plain text. I didn't find a solution for this problem ...

nalply commented 4 years ago

Thanks, this is really helpful. I could get it working.

alexolog commented 4 years ago

How can I verify that a particular header was deleted/added/modified as expected?

nalply commented 4 years ago

You can set Content-Type: text/plain, then all HTML is shown as plain text. Don't forget to remove this because your browser gets unusable.

Please take care to discern headers whether they are for the request or the response. For the request, you can inspect the headers, for the response this doesn't work, however you can use the text/plain test.

alexolog commented 4 years ago

@nalply, that does not help me check whether a specific header was added/modified/deleted according to my rules.

An acceptable solution would be to output the before and after values to the console.

didierfred commented 4 years ago

You can see the information on debug log of the extension, you have to activate the option via the button parameters in the plugin . The log can be seen in the extension debugging console of the browser. To access this console for firefox :

alexolog commented 4 years ago

I see no such button there. Can you please post a screenshot?

didierfred commented 4 years ago

It is the inspect button

image