HttpHandler and fbml

Dec 17, 2009 at 12:54 PM

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 3: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
Date:Fri, 18 Dec 2009 15:29:50 GMT

And when i go through facebook:

(Status-Line):HTTP/1.1 200 OK
Date:Fri, 18 Dec 2009 15:24:54 GMT
Expires:Mon, 26 Jul 1997 05:00:00 GMT
Cache-Control:private, no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Content-Type:text/html; charset=utf-8


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 4: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 19, 2009 at 12:01 AM

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

Dec 19, 2009 at 5:46 PM

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

Dec 20, 2009 at 12:27 AM

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.