-
Notifications
You must be signed in to change notification settings - Fork 434
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Respect
turbo-visit-control
for frame requests (#867)
Turbo normally performs a fill page reload whenever a response contains the appropriate `turbo-visit-control` meta tag: <meta name="turbo-visit-control" content="reload"> Such responses are considered "not visitable". For frame requests, we have previously been ignoring any `turbo-visit-control` set in the response, and instead treating all valid frame responses as "visitable". This commit changes this behaviour so that `turbo-visit-control` will be treated consistently for both frame and non-frame requests. As well as being more consistent, this provides a useful escape hatch for situations where a frame request redirects to something that should be a full page reload, but which would be prevented due to that content missing the expected frame. The class example of this is when an expired session causes a frame request to be redirected to a login page. By including `turbo-visit-control` on that login page, we can ensure that it is always rendered as a full page, and never hidden by a failed frame request.
- Loading branch information
1 parent
91ee8f6
commit 1e78f3b
Showing
4 changed files
with
64 additions
and
27 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>Frame</title> | ||
<script src="/dist/turbo.es2017-umd.js" data-turbo-track="reload"></script> | ||
<meta name="turbo-visit-control" content="reload" /> | ||
</head> | ||
<body> | ||
<h1>Unvisitable page loaded</h1> | ||
|
||
<turbo-frame id="missing"> | ||
<h1>Frame content</h1> | ||
</turbo-frame> | ||
</body> | ||
</html> |
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