Open Bug 190168 Opened 22 years ago Updated 1 year ago

javascript reload() of page in reponse to POST request sends GET request instead of POST.

Categories

(Core :: DOM: Navigation, defect)

x86
Windows 2000
defect

Tracking

()

People

(Reporter: john, Unassigned)

References

()

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3a) Gecko/20021212
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3b) Gecko/20030122

Using javascript:window.document.reload() in a page generated by a PUT request
sends a GET request instead of the PUT request.  In older versions (NS7, 1.3a,
1.0) BOTH a GET and a PUT request are sent.


Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3b) Gecko/20030122
**********************
APACHE ACCESS.LOG FILE 
**********************
(original request)
192.168.3.1 - - [22/Jan/2003:13:04:28 -0800] "POST
/TOUR00/REPORTS/Booking_Info.taf?BRN=348056&_function=UpdateBooking&_UserReference=934053CF09A89EE73E2F06C9
HTTP/1.1" 200 5604

(reload request)
192.168.3.1 - - [22/Jan/2003:13:04:36 -0800] "GET
/TOUR00/REPORTS/Booking_Info.taf?BRN=348056&_function=UpdateBooking&_UserReference=934053CF09A89EE73E2F06C9
HTTP/1.1" 200 18934



Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3a) Gecko/20021212

**********************
APACHE ACCESS.LOG FILE 
**********************

(Original request)
192.168.3.1 - - [22/Jan/2003:12:17:31 -0800] "POST
/tour00/reports/booking_info.taf?BRN=348056&_function=UpdateBooking&_UserReference=72632817AA3E994A3E2EF2F3
HTTP/1.1" 200 2156

(From the javascript reload() call)
192.168.3.1 - - [22/Jan/2003:12:17:53 -0800] "POST
/tour00/reports/booking_info.taf?BRN=348056&_function=UpdateBooking&_UserReference=72632817AA3E994A3E2EF2F3
HTTP/1.1" 200 18919
192.168.3.1 - - [22/Jan/2003:12:17:53 -0800] "GET
/tour00/reports/booking_info.taf?BRN=348056&_function=UpdateBooking&_UserReference=72632817AA3E994A3E2EF2F3
HTTP/1.1" 200 18919


**************
Page Contents:
**************
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> 
<link REL="StyleSheet" HREF="CSS/BookingInfo.CSS" TYPE="text/css">
</head>
<body>
<div CLASS="DatabaseErrorsText">
There were database problems during the update.  Odds are that 
<a HREF="" onClick="javascript:window.location.reload();">trying again</a> will
solve
the problem.  You may <a HREF="" onClick="javascript:window.location.reload();">
try again by clicking here</a> or by clicking on the Refresh or Reload button of
your
browser.
</div>
</body>
</html>


Reproducible: Always

Steps to Reproduce:
1. Create a CGI form that uses the POST method.
2. Put a link on the results page of that form that contains:
onClick="javascript:window.document.reload();"
3.  Use the browser to submit the page.
4.  Click on the link to reload the page.
5.  Look at the logs.

Actual Results:  
The reload sent both a POST and a GET request to the Web server.

Expected Results:  
Only sent a POST request.

I have reproduced this on Netscape 7.0 (Win2K), Mozilla 1.3a build 2002121215
(Win2K), and Mozilla 1.0 (Debian/1.0.0-0.woody.1).
Phoenix 0.5 sends two GET requests.
john, this looks like a session history thing....
Yeah, sounds like session history--CC'ing people who might have seen this
before.  bug 180598 might be related ... perhaps that is the same issue, and the
anchors are creating a new session history entry (which is GET).  Bug 167458
also sounds a suspicious.
This is session history problem. 
Assignee: form-submission → radha
Component: Form Submission → History: Session
correcting summary (PUT -> POST)
Summary: javascript reload() of page in reponse to PUT request sends GET request instead of PUT. → javascript reload() of page in reponse to POST request sends GET request instead of POST.
This is an automated message, with ID "auto-resolve01".

This bug has had no comments for a long time. Statistically, we have found that
bug reports that have not been confirmed by a second user after three months are
highly unlikely to be the source of a fix to the code.

While your input is very important to us, our resources are limited and so we
are asking for your help in focussing our efforts. If you can still reproduce
this problem in the latest version of the product (see below for how to obtain a
copy) or, for feature requests, if it's not present in the latest version and
you still believe we should implement it, please visit the URL of this bug
(given at the top of this mail) and add a comment to that effect, giving more
reproduction information if you have it.

If it is not a problem any longer, you need take no action. If this bug is not
changed in any way in the next two weeks, it will be automatically resolved.
Thank you for your help in this matter.

The latest beta releases can be obtained from:
Firefox:     http://www.mozilla.org/projects/firefox/
Thunderbird: http://www.mozilla.org/products/thunderbird/releases/1.5beta1.html
Seamonkey:   http://www.mozilla.org/projects/seamonkey/
OK, I can reproduce the bug using Firefox 1.5b1.  Testcase here:
http://friedfish.homeip.net/test/bugs/190168/test.html

The bug is that we behave differently than IE when the user clicks on an anchor
tag that has an empty href attribute and a onclick handler that triggers a page
reload.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Component: History: Session → Document Navigation
QA Contact: vladimire → docshell
Assignee: radha → nobody
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.