Sign in to follow this  

[web] Firefox sends duplicate Http requests

This topic is 3317 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey! I was making a "guess the number" game. Basically what it is is a server that one can connect to with a browser, and it sends this page to the client:
<html>
<head><title>Number Guess Game</title>
<script type = "text/javascript">
function inputfocus(form){
form.guess.focus()
}
</script>
</head>
<body onLoad="inputfocus(document.guessform);">
Welcome to the Number Guess Game. Guess a number between 1 and 100.
<form name="guessform">
<input type=text name=guess>
<input type=submit value="Guess">
</form>
</body>
</html>


When you get it right the server tells you how many times it took. Everything worked good, until I tried it with Firefox. I noticed I was getting it right but, according to the server, after about double the amount of times I actually guessed. I took a look with a sniffer, and it turns out firefox sent two copies of the http request each time. Why? What can make this happen?

Share this post


Link to post
Share on other sites
Do you return a proper HTTP header before the actual contents? Firefox might try to parse the data as a header, and upon failure, re-send a more general request (that doesn't specify desired content types, for example).

You could dump the request header to the response stream to see what your browser is asking from the server.

Share this post


Link to post
Share on other sites

This topic is 3317 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this