Help kill ghost request

I've been troubleshooting a problem with my captcha and finally figured out that any time I make one request to my localhost server, it receives and processes two requests, for example if i got to localhost:3000/users/test this shows up in my log:

<script src='http://pastie.org/534977.js’></script>

This is really tripping up my captcha (which used to work) it renders the image from the first request, but will only accept the characters from the second request. I have reproduced this problem with a sample rails app, and one other application, so it looks like a possible problem with my rails install, possibly a path problem? I also tried restarting my computer, just incase, but it didn't help. This is totally alien to me, if anyone has any troubleshooting tips please let me know, it is a little difficult for users to fill out a captcha, if the characters in the image are wrong.

Link to pastie:

http://pastie.org/534977

Without seeing all of the code, it's only a WAG, but I'd bet your first request is from loading the page, and the second is being triggered by a JS onload (or domready, or somesuch) event somewhere.

Maybe you could make available a small test app that demonstrates the problem?

In some browsers, the following tag will result in a second request to the server:

I would look for situations where a blank image/js file/css file, etc… would be loaded.

Some browsers including firefox (i believe)

mmm -- actually, it worked for me the first time: OS X/FF3.0.11 with the Firebug net console open to watch the interaction. No prob.

Ain't that always the way? :slight_smile:

I've got to run off to do something else now, but will try to take a look at the code later, maybe I can reproduce locally.

Good find, and thanks for reporting it!