Bug 50493 - Web Inspector: [Extension API] add support for adding/overriding HTTP request headers
Summary: Web Inspector: [Extension API] add support for adding/overriding HTTP request...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Andrey Kosyakov
URL:
Keywords:
Depends on:
Blocks: 51246
  Show dependency treegraph
 
Reported: 2010-12-03 15:16 PST by Andrey Kosyakov
Modified: 2010-12-17 05:28 PST (History)
11 users (show)

See Also:


Attachments
patch (27.90 KB, patch)
2010-12-03 15:23 PST, Andrey Kosyakov
no flags Details | Formatted Diff | Diff
patch (28.73 KB, patch)
2010-12-14 08:21 PST, Andrey Kosyakov
no flags Details | Formatted Diff | Diff
patch to land (28.61 KB, patch)
2010-12-15 11:00 PST, Andrey Kosyakov
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Kosyakov 2010-12-03 15:16:16 PST
Being able to modify HTTP request headers for requests generated by the inspected page would allow an extension to communicate with server via custom server (think FirePHP), control caching policies or set custom user agents.
Comment 1 Andrey Kosyakov 2010-12-03 15:23:46 PST
Created attachment 75556 [details]
patch
Comment 2 Pavel Feldman 2010-12-08 07:08:59 PST
Comment on attachment 75556 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=75556&action=review

> WebCore/inspector/InspectorController.h:178
> +    void applyOverrideHeaders(ResourceRequest&);

Can you do this in willSendRequest instead?

> WebCore/inspector/front-end/ExtensionServer.js:161
> +	var allHeaders = {};

Wrong indent
Comment 3 Andrey Kosyakov 2010-12-14 08:21:31 PST
Created attachment 76538 [details]
patch

- now applying header overrides in InspectorController::willSendReqeust()
- fixed test output stability
- rebased
- fixed style
Comment 4 Pavel Feldman 2010-12-15 04:41:16 PST
Comment on attachment 76538 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=76538&action=review

> WebCore/inspector/InspectorController.cpp:1833
> +        m_overrideHeaders->add(it->first, value);

These are not necessarily "override" header since they are going to be overriden by the network stack. "Extra" headers?
Comment 5 Andrey Kosyakov 2010-12-15 11:00:48 PST
Created attachment 76668 [details]
patch to land

- rebased
- overrideHeaders -> extraHeaders
Comment 6 Eric Seidel (no email) 2010-12-15 16:06:32 PST
Did you mean to mark you r"patch to land" with cq+ or r? or something?  Or did it already get landed?
Comment 7 Andrey Kosyakov 2010-12-16 04:50:31 PST
(In reply to comment #6)
> Did you mean to mark you r"patch to land" with cq+ or r? or something?  Or did it already get landed?

Neither -- this was meant to be "JFYI only". I'm about to land manually later at a convenient moment (the tests may be platform-sensitive and I'd like to keep an eye on them).
Comment 8 Andrey Kosyakov 2010-12-17 04:37:31 PST
Manually committed r74234: http://trac.webkit.org/changeset/74234