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:

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

On Sun, Jul 5, 2009 at 12:33 PM, Richard
Schneeman[email protected] wrote:

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

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?

Hassan S. ------------------------ [email protected]
twitter: @hassan

Hey hassan thanks for the reply, It looks like the problem isn’t with
my server, seeing two requests, that is normal for my localhost and for
my sites on dreamhost. However it doesn’t mean that my captcha problem
went away…it took a little while to get up and running, but here is a
hosted demo of the problem:

http://snowmaninthesun.dreamhosters.com

Here is the complete source code to the demo (its a simple rails app
with the simple_captcha plugin and some scaffolding):

http://github.com/snowmaninthesun/captchaProblemDemo/tree/master

If you go to http://snowmaninthesun.dreamhosters.com , the first time
you enter the captcha it doesn’t work…every time after that it will
work. More information on the problem is listed at the site. This is
different from what i’m seeing at my other site
http://www.uniteddictionary.com/new_slang . Which will sometimes work,
and sometimes not, unlike this demo which seems to fail consistently.
Let me know if you have any ideas as to what may be causing this 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.

On Sun, Jul 5, 2009 at 10:19 PM, Hassan S. <

On Mon, Jul 6, 2009 at 2:25 PM, Richard
Schneeman[email protected] wrote:

If you go to http://snowmaninthesun.dreamhosters.com , the first time
you enter the captcha it doesn’t work…

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.

Hassan S. ------------------------ [email protected]
twitter: @hassan

Thanks for this info hassan “OS X/FF3.0.11” i tried it in safari, it
worked great…i tried checked my version of firefox its 3.0.11, and i’m
running OS X…so what could be different???

I realized that i have YSlow set to autorun, when i turned that off and
visited my previous posted link it magically works…that would explain
why it previously worked, but quit. OMFG i’ve lost about a day of my
life due to an “optimization” plugin. In retrospect it seems so obvious,
thanks for your patience, and double checking. I’m in the process of
making sure the YSlow developers are aware of this potential situation,
but the obvious immediate fix is to turn off YSlow.

I started teaching myself rails about 2 years ago, and if it wasn’t for
this forum, i would have given up long ago, so thanks for bearing with
me!!

Some browsers including firefox (i believe)

On Mon, Jul 6, 2009 at 5:19 PM, Richard
Schneeman[email protected] wrote:

I realized that i have YSlow set to autorun, when i turned that off and
visited my previous posted link it magically works…that would explain
why it previously worked, but quit. OMFG i’ve lost about a day of my
life due to an “optimization” plugin. In retrospect it seems so obvious,
thanks for your patience, and double checking. I’m in the process of
making sure the YSlow developers are aware of this potential situation,
but the obvious immediate fix is to turn off YSlow.

Good find, and thanks for reporting it!


Hassan S. ------------------------ [email protected]
twitter: @hassan

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs