-
Notifications
You must be signed in to change notification settings - Fork 415
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restore correct Accept header for form submissions
Closes #141. Follows-up #52. --- When creating the headers for a `FetchRequest`, provide the default headers to the delegate by adding an argument to the `additionalHeadersForRequest` signature so that delegates can incorporate the current values if they choose to. They're passed as a copy to prevent delegates from destructively acting upon them, with the intention that delegates merge values _into_ them. Testing --- Add a guard middleware to the test server to reject _all_ requests that don't specify an [Accept][] header containing `"text/html, application/xhtml+xml"`. Next, guard Stream requests with a similar check for `"text/vnd.turbo-stream.html"`. Since those endpoints are behind the guard middleware, they'll also require `"text/html, application/xhtml+xml"` as well. Finally, replace the Stream functional test's explicit call to `fetch` with a `<form>` element submitting with the same content. [Accept]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept
- Loading branch information
1 parent
4c439b9
commit ca350d9
Showing
5 changed files
with
33 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters