Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What should happen with location.reload() on a page that is a POST result? #3215

Closed
bzbarsky opened this issue Nov 8, 2017 · 4 comments · Fixed by #6315
Closed

What should happen with location.reload() on a page that is a POST result? #3215

bzbarsky opened this issue Nov 8, 2017 · 4 comments · Fixed by #6315
Labels
interop Implementations are not interoperable with each other topic: forms topic: location topic: navigation

Comments

@bzbarsky
Copy link
Contributor

bzbarsky commented Nov 8, 2017

Consider this testcase:

<form action="https://software.hixie.ch/utilities/cgi/test-tools/echo" method=post>
  <input type="submit" name="something" value="Submit me">
</form>
  1. Load the testcase.
  2. Click the button.
  3. Open developer tools and evaluate "location.reload()".

I can't do step 3 in Safari, because it won't let me open developer tools on that page. But in Chrome, Firefox, and Edge, in step 3 the reload resends the POST data. Firefox and Edge prompt for the repost; Chrome just silently does it.

If I read the spec right, we're in https://html.spec.whatwg.org/multipage/history.html#dom-location-reload in the "Otherwise" case, which just says to navigate to the document's URL, ignoring any POST data, which doesn't match the above-described browser behavior.

@bzbarsky
Copy link
Contributor Author

bzbarsky commented Nov 8, 2017

// cc @annevk @domenic

@domenic domenic added interop Implementations are not interoperable with each other topic: forms topic: navigation labels Nov 8, 2017
@annevk
Copy link
Member

annevk commented Nov 9, 2017

I wonder how @mcmanus feels about removing the prompting. As I understand it servers already need to be resilient against duplicate POSTs due to various protocol issues. Given that, it seems unfortunate to have a dialog the user isn't really helped with (or can typically make sense of).

@bzbarsky
Copy link
Contributor Author

bzbarsky commented Nov 9, 2017

The prompting is a separate issue. This issue is about the server-observable behavior: does the POST get resent at all?

@annevk
Copy link
Member

annevk commented Nov 9, 2017

Understood and we should fix that, but I'm wondering if the new language (and tests) needs to account for the prompting or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interop Implementations are not interoperable with each other topic: forms topic: location topic: navigation
Development

Successfully merging a pull request may close this issue.

4 participants