Jump to content
  • Advertisement
Sign in to follow this  
tufflax

[web] Firefox sends duplicate Http requests

This topic is 3629 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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!