Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upXHR must not trigger any upload events when making GET or HEAD request with non-null data #3920
Labels
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
/XMLHttpRequest/send-entity-body-get-head-async.htm tests that no events (progress, loadstart, loadend) are fired on an the xhr.upload object when making a GET or HEAD request with non-null data.
The current implementation triggers the progess and loadend events on the upload object when the the state changes to HEADERS_RECEIVED irrespective of the method type, hence failing the assertion in the test.
The XHR spec clearly states that the request body is set to null when the method is either GET or HEAD (see step 3). This means that the rules in the HTTP Fetch spec, section 4.3 step 11, under "If HTTPRequest's body is non-null, run these substeps:" do not apply to GET and HEAD requests and therefore no events must be triggered on the xhr.upload object.