0

I would like to load a single image on a Facebook Custom Tab. The content is available online on this link: https://d3p61garc8eqm1.cloudfront.net/facebook.html

I hosted the files via Amazon S3. Configured Route 53 to handle my DNS and activated CloudFront to serve HTTPS to the targeted bucket.

I also changed the CORS S3 config to be like this:

<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
    <CORSRule>
        <AllowedOrigin>*</AllowedOrigin>
        <AllowedMethod>POST</AllowedMethod>
        <AllowedMethod>PUT</AllowedMethod>
        <AllowedMethod>DELETE</AllowedMethod>
        <MaxAgeSeconds>3000</MaxAgeSeconds>
        <ExposeHeader>ETag</ExposeHeader>
        <AllowedHeader>*</AllowedHeader>
    </CORSRule>
</CORSConfiguration>

After all that I still get the 405 when accessing via Facebook.

This is the verbose output when accessing the page via SSL.

curl -I -v -ssl https://d3p61garc8eqm1.cloudfront.net/facebook.html
* Hostname was NOT found in DNS cache
*   Trying 54.230.194.31...
* Connected to d3p61garc8eqm1.cloudfront.net (54.230.194.31) port 443 (#0)
* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
* Server certificate: *.cloudfront.net
* Server certificate: VeriSign Class 3 Secure Server CA - G3
* Server certificate: VeriSign Class 3 Public Primary Certification Authority - G5
> HEAD /facebook.html HTTP/1.1
> User-Agent: curl/7.37.1
> Host: d3p61garc8eqm1.cloudfront.net
> Accept: */*
>
< HTTP/1.1 200 OK
HTTP/1.1 200 OK
< Content-Type: text/html
Content-Type: text/html
< Content-Length: 428
Content-Length: 428
< Connection: keep-alive
Connection: keep-alive
< Date: Wed, 01 Jul 2015 01:44:29 GMT
Date: Wed, 01 Jul 2015 01:44:29 GMT
< Last-Modified: Wed, 01 Jul 2015 01:44:06 GMT
Last-Modified: Wed, 01 Jul 2015 01:44:06 GMT
< ETag: "89fc2a26c87fbc6d16e6cb91a86853b9"
ETag: "89fc2a26c87fbc6d16e6cb91a86853b9"
* Server AmazonS3 is not blacklisted
< Server: AmazonS3
Server: AmazonS3
< Age: 3455
Age: 3455
< X-Cache: Hit from cloudfront
X-Cache: Hit from cloudfront
< Via: 1.1 4ee6cbd5f14ab44f81cd41b0f1148c25.cloudfront.net (CloudFront)
Via: 1.1 4ee6cbd5f14ab44f81cd41b0f1148c25.cloudfront.net (CloudFront)
< X-Amz-Cf-Id: 4C5RXGqHqaURXGk1KuYBRS28QxKTZ60RnS4Na72iX8jiGhv85HxqLw==
X-Amz-Cf-Id: 4C5RXGqHqaURXGk1KuYBRS28QxKTZ60RnS4Na72iX8jiGhv85HxqLw==

<
* Connection #0 to host d3p61garc8eqm1.cloudfront.net left intact

This is the verbose output when accessing the page via SSL and a POST request.

curl -X POST -v -ssl https://d3p61garc8eqm1.cloudfront.net/facebook.html
* Hostname was NOT found in DNS cache
*   Trying 54.230.38.2...
* Connected to d3p61garc8eqm1.cloudfront.net (54.230.38.2) port 443 (#0)
* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
* Server certificate: *.cloudfront.net
* Server certificate: VeriSign Class 3 Secure Server CA - G3
* Server certificate: VeriSign Class 3 Public Primary Certification Authority - G5
> POST /facebook.html HTTP/1.1
> User-Agent: curl/7.37.1
> Host: d3p61garc8eqm1.cloudfront.net
> Accept: */*
>
< HTTP/1.1 405 Method Not Allowed
< Content-Type: text/html; charset=utf-8
< Content-Length: 422
< Connection: keep-alive
< Allow: GET, HEAD, OPTIONS
< Date: Thu, 02 Jul 2015 05:08:45 GMT
* Server AmazonS3 is not blacklisted
< Server: AmazonS3
< X-Cache: Error from cloudfront
< Via: 1.1 f519cbbbbf1657343dde8ed4d32a9966.cloudfront.net (CloudFront)
< X-Amz-Cf-Id: XUs_pH1824qPFncW7InM2TXhTTALoJNTFVOthfHGJGkBBw-yqduzFg==
<
<html>
<head><title>405 Method Not Allowed</title></head>
<body>
<h1>405 Method Not Allowed</h1>
<ul>
<li>Code: MethodNotAllowed</li>
<li>Message: The specified method is not allowed against this resource.</li>
<li>Method: POST</li>
<li>ResourceType: OBJECT</li>
<li>RequestId: F0B0DC4215D77C81</li>
<li>HostId: mWzBa6r5GBOLiHmff36LyX4g2uIcUTwWSJx+2EwOapzhnF+42oBObyWz2nczQHafYWUb2fnx9UU=</li>
</ul>
<hr/>
</body>
</html>
* Connection #0 to host d3p61garc8eqm1.cloudfront.net left intact

I would love some help on this. Trying everything I found online but nothing worked.

  • 1
    Facebook makes a POST request to your app on initial load into the iframe. So your cURL output doesn’t help much, cause you did a HEAD request. Make a POST request, and see what that gets you. – CBroe Jul 01 '15 at 16:41
  • Thanks for the feedback! – Pedro Marins Jul 02 '15 at 05:09
  • http://stackoverflow.com/questions/28593531/s3-post-request-to-s3-with-response-405, http://stackoverflow.com/questions/19327410/fine-uploader-to-s3-bucket-getting-405-method-not-allowed-error – CBroe Jul 02 '15 at 06:56
  • I just solve my problem. Since didn't found a easy workaround for the issue I started looking for some services to help me. And, since my intentions was to show a simple html page on a facebook tab, I used this service as a solution: http://www.thunderpenny.com/ They have a free hosting for the static html the fitted my needs. BUT, I could only do that cause I was using CloudForge to serve HTTPS for my amazon s3 files. – Pedro Marins Jul 04 '15 at 13:48

0 Answers0