HttpHandler and fbml

Dec 17, 2009 at 11:54 AM

Hi guys,

Has anyone managed to get an HttpHandler to serve images back to facebook and actually have it work? It just displays a broken image cross where the images should be, yet when i try invoking the same handler through localhost and not via facebook it works fine and the image appears ok....

I'm wondering if its timing out or something?

Please help! :)

Cheer, Paul.

Dec 18, 2009 at 2:48 PM

More info, looks like the data facebook is using in the httpresponse is rubbish. This is what i get when i go through localhost:

(Status-Line):HTTP/1.1 200 OK
Server:Microsoft-IIS/5.1
Date:Fri, 18 Dec 2009 15:29:50 GMT
X-Powered-By:ASP.NET
X-AspNet-Version:2.0.50727
Cache-Control:private
Content-Type:image/jpeg
Content-Length:6907

And when i go through facebook:

(Status-Line):HTTP/1.1 200 OK
Date:Fri, 18 Dec 2009 15:24:54 GMT
Server:Apache/1.3.41.fb2
Expires:Mon, 26 Jul 1997 05:00:00 GMT
Cache-Control:private, no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma:no-cache
P3P:CP="DSP LAW"
X-Cnection:close
Transfer-Encoding:chunked
Content-Type:text/html; charset=utf-8
Content-Encoding:gzip

 

And the actual data is gibberish (i.e, not a jpg header) and its too short AND it thinks its plain text... Anyone know whats going on? :)

Dec 18, 2009 at 3:36 PM

Found it!

The problem is that facebook doesn't accept relative URLs in IMG tags. So i was using the *app relative* url instead - for some reason this causes facebook to interpret the results as FBML and boom!

Changing the path in the IMG tag to be directly to my server fixes it. The trouble is i'm on a dynamic IP with no DNS, so every day i would need to update not only the canvas callback url (which i currently already do have to) but all the IMG tags as well!

There must be a better way? :)

Dec 18, 2009 at 11:01 PM

For development i use localhost and for production dynamic IP is a no-go.

Dec 19, 2009 at 4:46 PM

You can't use localhost if you've got an fbml page, though?

Dec 19, 2009 at 11:27 PM

Yes, fbml debugging is a problem. Unfortunatly I don't know any good solution to local fbml debugging. I myself resort to uploading my changes to hosted account, but I don't do mush of the fbml development.