laurentj / slimerjs

A scriptable browser like PhantomJS, based on Firefox
http://slimerjs.org
Other
3k stars 259 forks source link

Wrong user agent and missing custom headers in CONNECT request #438

Open wskorodecki opened 8 years ago

wskorodecki commented 8 years ago

I'm connecting to website via HTTPS URL. I'm also using a proxy. As far as I can see SlimerJS is correctly setting my User-Agent header and all custom headers for GET request, but not for CONNECT request (which is being used in SSL).

Screenshot from Wireshark

It can be easily checked by using Wireshark or Charles.

laurentj commented 8 years ago

Note for contribution: Probably the easiest way to fix the bug, is to set the preference general.useragent.override with the user agent, but it will be the user agent for every opened webpages and loaded resources... Else we could see if we can intercept CONNECT request into net-log.js..

wskorodecki commented 8 years ago

It is impossible to intercept CONNECT request in http-on-modify-request without this patch or similar.

wskorodecki commented 7 years ago

@laurentj What do you think about my patch? Can we use it as a temporary workaround?