Add Idempotency-Key header to POST and PATCH requests.
Categories
(Core :: Networking: HTTP, enhancement, P2)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox135 | --- | fixed |
People
(Reporter: valentin, Assigned: smayya)
References
(Blocks 1 open bug, Regressed 1 open bug)
Details
(Keywords: webcompat:platform-bug, Whiteboard: [necko-triaged][necko-priority-queue])
Attachments
(3 files)
See https://mailarchive.ietf.org/arch/msg/httpapi/qAKwsPgiz7wbnorZcQTiGKMarEk for context.
https://datatracker.ietf.org/doc/draft-ietf-httpapi-idempotency-key-header/
The changes would be something like:
If the request is POST/PATCH and it doesn't have the "Idempotency-Key" header set, then add one with a random UUID value. (If it already has one, set by fetch for example, we should not overwrite it).
Add a test that the same header is sent when refreshing the page that sent the inital POST.
Updated•1 year ago
|
| Reporter | ||
Comment 1•1 year ago
|
||
- We generate a random string when the POST or PATCH http channel don't have an "Idempotency-Key" and set it.
- Make sure we set the same Idempotency-Key header when we refresh the page and the POST dialog shows up (we are posting the same content again, it should use the same idempotency-key).
- Figure out how the repost-ing is triggered. TODO
Updated•1 year ago
|
| Assignee | ||
Updated•1 year ago
|
| Assignee | ||
Comment 2•1 year ago
|
||
| Assignee | ||
Comment 3•1 year ago
|
||
Updated•1 year ago
|
Updated•1 year ago
|
Backed out for causing wpt failures @ fetch-request-xhr.https.html
- Backout link
- Push with failures
- Failure Log
- Failure line:
TEST-UNEXPECTED-FAIL | /service-workers/service-worker/fetch-request-xhr.https.html | event.request has the expected headers for same-origin POST. - promise_test: Unhandled rejection with value: object "Error: assert_array_equals: event.request has the expected headers for same-origin POST. lengths differ, expected array ["accept", "content-type"] length 2, got ["accept", "content-type", "idempotency-key"] length 3"
————————————————————————————
Backed out for causing mochitest failures @ test_fetch_cors_sw_reroute.html
- Push with failures
- Failure Log
- Failure line:
TEST-UNEXPECTED-FAIL | dom/tests/mochitest/fetch/test_fetch_cors_sw_reroute.html | Expected test failure for {"pass":1,"method":"POST","body":"hi there","noAllowPreflight":1}
————————————————————————————
Backed out for causing dt failures @ browser_net_copy_as_curl.js
- Push with failures
- Failure Log
- Failure line:
TEST-UNEXPECTED-FAIL | devtools/client/netmonitor/test/browser_net_copy_as_curl.js | Timed out while polling clipboard for requested data, got: curl 'https://example.com/browser/devtools/client/netmonitor/test/sjs_simple-test-server.sjs' -X POST -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:134.0) Gecko/20100101 Firefox/134.0' -H 'Accept: */*' -H 'Accept-Language: en-US' -H 'Accept-Encoding: gzip, deflate, br, zstd' -H 'X-Custom-Header-1:
| Assignee | ||
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
| Assignee | ||
Comment 6•1 year ago
|
||
Depends on D227802
| Assignee | ||
Comment 7•1 year ago
•
|
||
Hey Martin,
There are couple of issues before we land this.
Do you think it is OK to treat IDK header as CORS-safe, i.e. can we use this header in fetch API's no-cors mode. Currently we treat the following headers as CORS-safe
I just noticed that the draft has expired. Do we have any reasons not to land this patch?
Kindly confirm.
Thanks
| Assignee | ||
Comment 8•1 year ago
|
||
Discussed internally with Martin.
Here are our next steps:
- Release this feature under a pref by safe-listing the IDK header.
- Contacting the spec author for further clarity on this one.
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Comment 10•1 year ago
|
||
Backed out for causing multiple failures.
- Backout link
- Push with failures - wpt failures
- Failure Log
- Failure line: TEST-UNEXPECTED-FAIL | /service-workers/service-worker/fetch-request-xhr.https.html | event.request has the expected headers for same-origin POST. - promise_test: Unhandled rejection with value: object "Error: assert_array_equals: event.request has the expected headers for same-origin POST. lengths differ, expected array ["accept", "content-type"] length 2, got ["accept", "content-type", "idempotency-key"] length 3"
- Push with failures - dt failures
- Failure Log
- Failure line: TEST-UNEXPECTED-FAIL | devtools/client/netmonitor/test/browser_net_copy_as_powershell.js | Timed out while polling clipboard for requested data, got: $session = New-Object Microsoft.PowerShell.Commands.WebRequestSession
Comment 11•1 year ago
|
||
Comment 12•1 year ago
|
||
Backed out for causing Wd assertion failures on nsHttpChannel.cpp
| Assignee | ||
Updated•1 year ago
|
Comment 13•1 year ago
|
||
Comment 14•1 year ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/49a118de2acc
https://hg.mozilla.org/mozilla-central/rev/26df7b20115e
https://hg.mozilla.org/mozilla-central/rev/a90576b7f21b
Updated•4 months ago
|
Description
•