How can we set CORS with public access

39 views
Skip to first unread message

Mihai

unread,
May 25, 2012, 6:32:30 AM5/25/12
to gs-dis...@googlegroups.com
I'm trying to set CORS with public access (*)  to a specific bucket. This is how the policy looks like but for some reasons it the browser fails to retrieve the content via ajax/json . Is there anything wrong in the xml policy ?

<?xml version="1.0" ?>
<CorsConfig>
    <Cors>
        <Origins>
            <Origin>
                *
            </Origin>
        </Origins>
        <Methods>
            <Method>
                GET
            </Method>
            <Method>
                HEAD
            </Method>
            <Method>
                OPTIONS
            </Method>
        </Methods>
        <ResponseHeaders>
            <ResponseHeader>
                x-goog-meta-foo1
            </ResponseHeader>
        </ResponseHeaders>
        <MaxAgeSec>
            3600
        </MaxAgeSec>
    </Cors>
</CorsConfig>

Google Storage Team

unread,
May 28, 2012, 1:42:49 PM5/28/12
to gs-dis...@googlegroups.com
Hi Mihai,

Your XML document looks reasonable to me. I also verified that syntax is accepted by gsutil and Google Cloud Storage on a test bucket. It's possible that your problem is due to access permissions rather than CORS but it's hard to say without more information (e.g. what error message you are receiving on the failed request). I would suggest capturing a network trace of your request and response stream. Chrome has a session trace feature, which you can access by clicking the config (monkey wrench) button and selecting Tools->Developer Tools. That should open a window at the bottom of your screen. Select the Network tab in that window, run your test and if the resulting trace doesn't help, copy/paste the trace to me at gs-...@google.com and I'll take a look.

Marc
Google Cloud Storage Team



--
You received this message because you are subscribed to the Google Groups "Google Cloud Storage" group.
To view this discussion on the web visit https://groups.google.com/d/msg/gs-discussion/-/LforoKrIjHYJ.
To post to this group, send email to gs-dis...@googlegroups.com.
To unsubscribe from this group, send email to gs-discussio...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gs-discussion?hl=en.

mihai

unread,
May 28, 2012, 1:49:25 PM5/28/12
to gs-dis...@googlegroups.com
Thanks a lot for the response. It seems it was a temporary cache issue though I'm not sure if it was on the browser or the bucket level. 

Mihai
Reply all
Reply to author
Forward
0 new messages