Skip to main content
Participating Frequently
May 15, 2009
Question

CFHTTP Trace Acting Weird?

  • May 15, 2009
  • 3 replies
  • 676 views

Wow, I haven't been here in a while, but I am completely stumped on this one. Let me see if I can explain...

There is a site that if you append an email address onto a URL, you can find out if someone has a profile on that site. For instance:

If typed directly into a browser: www.some-site.com/?email=bob@bob.com will then forward you to a URL that is formatted like so: www.some-site.com/users/bob

Fair enough... I have a client that wants to enter a few thousand email addresses into a form (comma separated), clicks search where then I append those email addresses one at a time to the end of www.some-site.com/?email=. I'm using CFHTTP (TRACE) as a way to do this because inside the returned FileContent, I get back "TRACE /user/bob ...." which is completely awesome cause I just run a small regex to extract the "/user/bob" append that onto www.some-site/, display to my client and everyone's happy. Hope I'm not just rambling here...

So, that's all fine and good... however, this is locally. When I put it on my live server and run it, i get back in filecontent:

"TRACE /?email=bob@bob.com...." Um... what? I've tried this on 4 different CF servers all with the same configuration (Windows/Apache/CF 😎 and everyone of them returns this data, but my local machine returns exactly what I need.

Anyone have ANY idea what's going on here?! I've been doing this stuff for years and I am completely at a loss now. Seems to me that CFHTTP would work the same on any server. I guess I was completely wrong

Thanks!

    This topic has been closed for replies.

    3 replies

    DefuseAuthor
    Participating Frequently
    May 15, 2009

    Nevermind, I got it! I did change it to GET, but I added the redirect attribute to false and then spit out cfhttp.responseheader.location and it works like a dream!

    Thanks for the responses. I appreciate it.

    ilssac
    Inspiring
    May 15, 2009

    Why are you using TRACE?  That's for debugging, it is just supposed to bounce back the headers.  That sounds exactly like the behavior you are describing.

    DefuseAuthor
    Participating Frequently
    May 15, 2009

    I'm using trace because it gives me back exactly what I want. Well, obviously, only locally. I think it's cause the other site forwards you somewhere when you make the request. HEAD and GET weren't returning anything like I needed. It's too bad, because TRACE was perfect!

    I can't imagine what in the world would cause it to act differently from the development platform to the live platform. I don't know the firewall rules or proxy configs for my hosts, so nothing I can compare it to there.

    ilssac
    Inspiring
    May 15, 2009

    My first guess would be that the remote server is actively combating your attempt.  Somehow detecting the scripted request and sending back something unusable.  Possible using host headers or something.  But why it works different on your local machine is a bit confounding.  Maybe a difference in firewalls or proxies or something.

    I don't know of anything inside of ColdFusion that would change this behavior.