This patch was generated with the following command:
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 's/return ([a-zA-Z0-9]+)\.ErrorCode\(\);/return \1.StealNSResult();/'
Note when the Fetch is coming from the main thread or a worker. Also
count Requests just passed through a Service Worker.
--HG--
extra : rebase_source : 5ab71144821a97f0ec1874d467da68f4fd171705
A no-cors mode request should not go through a nsCORSProxyListener, which can only handle same-origin and cors mode.
The test for no-cors was passing allowOrigin, which was converting it into a CORS request, which is why it was passing.
I also realized that it is port 8888 and not 8000, so fixed that in some of the redirect tests.
--HG--
extra : rebase_source : a959877e9fc65ae177dfd480258d164d7b2e6af5
Use nsCrossSiteListenerProxy.h helpers to implement CORS support.
Several CORS fixes and lots of CORS tests.
Fixes:
Use empty string stream if response has no stream.
Parse Access-Control-Expose-Headers correctly.
Copy over remaining InternalRequest constructor attributes and set unsafe request flag.
Call FailWithNetworkError() in more cases.
Add non-simple Request headers to unsafeHeaders list for CORS check.
Do not AsyncOpen channel directly when CORS preflight is required.
Fix check for simple request method (was checking the opposite condition).
--HG--
extra : rebase_source : 4b08f6a5959e470394c88249b39464b3b7d20948
This patch has the following big pieces:
HTTP support in FetchDriver, which requires the principal of the caller to be passed.
Managing worker lifetime when a fetch() call is in progress.
Managing worker lifetime when a Response body is being read.
Using nsIPipe to link network streams to Request/Response body streams.
Using nsIInputStreamPump to convert Request/Response body streams into respective types.
Folded:
Bug 1039846 - Fetch API: Use a pipe to immediately start writing HTTP body data to InternalResponse.
Bug 1039846 - Assert bodystream can be set only once
Bug 1039846 - Add feature when handling fetch responses on workers
Bug 1039846 - Try to retarget http fetch delivery off main thread.
Bug 1039846 - Safely consume body using nsIInputStreamPump on workers and main thread.
Bug 1039846 - Retarget body reading to stream transport service.
--HG--
extra : rebase_source : 809c4e799835ad6fd153b673cad70109d257ab6c