• 13
• 15
• 27
• 9
• 9

# [web] Firefox sends duplicate Http requests

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

## 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>
<script type = "text/javascript">
function inputfocus(form){
form.guess.focus()
}
</script>
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 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.