Closed Bug 1900375 Opened 4 months ago Closed 3 months ago

Expose an interface to provide a fake response object

Categories

(Core :: Networking, task, P2)

task
Points:
8

Tracking

()

RESOLVED FIXED
129 Branch
Tracking Status
firefox129 --- fixed

People

(Reporter: jdescottes, Assigned: jdescottes)

References

(Blocks 1 open bug)

Details

(Whiteboard: [webdriver:m11][necko-triaged])

Attachments

(2 files)

The network.provideResponse command of WebDriver BiDi allows clients to specify the response of a request intercepted before it was sent to the server.

Clients can set the following properties: headers (+ cookies), status, status message and response body.
In that case, the request should not hit the network, we want to build a fake response using the information provided by the client.
Also, we are not concerned with performing security checks or providing accurate timings in such a scenario.

Discussing with :valentin, one option is to expose an interface so that the BiDi codebase can set an xpcom object which encapsulates the fake response. Once this is set and the request is resumed, before connecting we will check the override, send out OnStart/onData/onStop and then cleanup the channel.

At the moment this should happen for requests blocked in http-on-before-connect, but ultimately we would like to use http-on-dispatching-transaction (Bug 1849686).

Severity: -- → N/A
Priority: -- → P2
Whiteboard: [webdriver:m11] → [webdriver:m11][necko-triaged]
Points: --- → 8
Blocks: 1849920
See Also: → 1834808
Blocks: 1904870
Pushed by jdescottes@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/750ee4b0609f Introduce new interface nsIReplacedHttpResponse to provide mock response data r=necko-reviewers,jesup https://hg.mozilla.org/integration/autoland/rev/7889072db20c Add setResponseOverride to nsIHttpChannelInternal.idl r=necko-reviewers,kershaw
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 129 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: