Code review comment for lp:~michael-sheldon/webbrowser-app/general-download-support

Revision history for this message
Olivier Tilloy (osomon) wrote :

> The "Referer" spelling is pretty interesting and something I only found out
> about whilst implementing this; it's actually a misspelling carried forward
> from the original HTTP spec, so the correct header for HTTP requests is
> "Referer" instead of "Referrer"
> (http://en.wikipedia.org/wiki/HTTP_referer#Origin_of_the_term_referer has a
> bit of detail on that).

Interesting. Thanks for the pointer, I learnt some history today :)

> Is there a mechanism by which we could be getting the overridden user agent?

Not without modifying the UA override mechanism. I see a few options:

 - In UbuntuWebContext, in the message handler for the networkRequestDelegate, we could store the url and corresponding override in a dictionary that would be exposed as a property (or a method) of the context. We would then query this dictionary to get the overridden UA for the URL of the current page, and if not found, use the default.

 - Alternatively, we could expose the UA override mechanism as a method of the context, but that’s not necessarily trivial as the mechanism involves user scripts which would need to be refactored to be exposed as generic JS libs.

 - Finally, another option would be to add an API to oxide itself to expose the HTTP headers for the current page, that might be useful for other use cases.

What do you think? In case you reckon option #1 is reasonable, feel free to go ahead with it (it shouldn’t be too much work). Other options look more involved, so I think it’s OK to go with the current implementation for now (but in that case please file a bug report and add a comment that points to it).

« Back to merge proposal