Jump to content
  • Advertisement
Sign in to follow this  

[web] Firefox sends duplicate Http requests

This topic is 3677 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:
<head><title>Number Guess Game</title>
<script type = "text/javascript">
function inputfocus(form){
<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">

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
Sign in to follow this  

  • Advertisement

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!