Forum Discussion

ChrisMaKi_15830's avatar
ChrisMaKi_15830
Icon for Nimbostratus rankNimbostratus
Apr 26, 2011

Facebook App does not like IIS

Hi folks,

 

Facebook had an App that allow you to publish data from your website direct onto your facebook profile page.

 

This sends a post to our IIS powered website. Our web server cannot deal with the post method and rejects the facebook url.

 

The sollution to this problem is to change the "post" to a "get" method. This should work but the problem is how do I change this http method with an iRule.

 

 

Any ideas welcomed

 

 

Chris

3 Replies

  • Hi Chris,

     

     

    There is no built in command for changing the HTTP method, but you could potentially rebuild the request.

     

     

    Can you provide an anomymized example of the POST request which gets sent to your web app?

     

     

    Aaron
  • Thanks for the response Aaron!

     

    here is the code:

     

     

    POST /dateien/partei/panorama/110309_pam/aschermittwoch1.html HTTP/1.0

     

    Host: www.xxx.xx

     

    Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, application/xaml+xml, application/x-ms-xbap, application/x-ms-application, */*

     

    Accept-Language: de,en-US;q=0.5

     

    Content-Type: application/x-www-form-urlencoded

     

    UA-CPU: x86

     

    User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; InfoPath.1; .NET4.0C; .NET4.0E)

     

    Cookie: __utma=37611442.xxxxxxxxxx.1303306266.1303312748.1303369519.5; __utmz=37611442.1303306266.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)

     

    X-Forwarded-Host: www.xxx.xx

     

    X-Forwarded-Server: www.xxx.xx

     

    Content-Length: 302

     

    Via: 1.1 wwwproxy.xxx.xx:80 (squid)

     

    X-Forwarded-For: x.x.x.x, x.x.x.x

     

    Cache-Control: no-cache, max-age=259200

     

    Connection: keep-alive

     

    X-Forwarded-For: x.x.x.x

     

     

    signed_request=xxxxxxxxxxxxxxxxxxxxg1wvZAlpvcJYmJRomgU4SG6UE.eyJhbGdvcml0aG0iOiJITUFDLVNIQTI1NiIsImlzc3VlZF9hdCI6MTMwMjUyMjA5NCwicGFnZSI6eyJpZCI6IjQwMTExMjk5MTUzNCIsImxpa2VkIjpmYWxzZSwiYWRtaW4iOnRydWV9LCJ1c2VyIjp7ImNvdW50cnkiOiJkZSIsImxvY2FsZSI6ImRlX0RFIiwiYWdlIjp7Im1pbixxxxxxxxxxx

     

     

    Now what we need is an irule to change: POST /dateien/partei/panorama/110309_pam/aschermittwoch1.html HTTP/1.0 to: GET /dateien/partei/panorama/110309_pam/aschermittwoch1.html HTTP/1.0

     

    and to delete the signed_request stuff at the bottom.

     

     

    Thanks again for any help,

     

    Chris

     

     

  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    You've gotta love Nat's codeshare entries:

     

     

    http://devcentral.f5.com/wiki/default.aspx/iRules/HTTP_mothod_conversion.html

     

     

    Colin