-
Notifications
You must be signed in to change notification settings - Fork 436
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GET form submissions to the current path
Closes #107 The [HTML specification][] outlines the algorithm for handling form submissions, and describes the steps involved in handling a `method=get` request with `application/x-www-form-urlencoded` encoding. However, it doesn't explicitly mention how to handle a `<form method="get">` submission when the `action` attribute is omitted and the current URL includes a query parameter that would be included within the `<form>` element fields' values. Determining the test cases to reproduce browser default behavior involved was some trial and error troubleshooting in real browsers with default (JavaScript-less) `<form>` submission handling. The algorithm appears to be as follows: * If there are no query parameters, append all field values as query parameters * If there are existing query parameters whose keys exist as `<form>` fields, override them based on the form field's value * If there are existing query parameters whose keys exist as _multiple_ `<form>` fields, override the first occurrence, and then append subsequent values [HTML specification]: https://html.spec.whatwg.org/#form-submission-algorithm
- Loading branch information
1 parent
178c817
commit ac4b0f9
Showing
4 changed files
with
86 additions
and
10 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