Skip to content

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

@bzbarsky

Description

@bzbarsky

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions