-
Notifications
You must be signed in to change notification settings - Fork 435
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes [446][]. When handling a `<form method="get" action="..." data-turbo-frame="...">` submission targeting a `<turbo-frame>` element, responses that don't redirect do not change the element's `[src]` attribute. Following the changes made in [424][], `<form>` submissions that result in `GET` requests are handled the same as other form submissions in that they fire `turbo:submit-start` and `turbo:submit-end` events. What [424][] did not account for is navigations initiated by `<form method="get">` submissions that _do not_ redirect. In response to those requests, this commit adds two additional criteria for updating the `<turbo-frame src="...">` attribute: * the response's status code is [200 OK][], which is idempotent and does not indicate a server-side state change (for example, like a [201 Created][] with a `Location:` header might) * the response's `Content-Type:` is HTML (not JSON or even Turbo Stream) Under those circumstances, the frame's `[src]` is updated. This commit adds test coverage for this new behavior along with additional coverage to guard against regressions. [446]: #446 [424]: #424 [200 OK]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/200 [201 Created]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/201
- Loading branch information
1 parent
ca1117b
commit c31f4cd
Showing
4 changed files
with
38 additions
and
4 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