Cross Origin Resource Sharing (CORS) and Google Docs

230 views
Skip to first unread message

Constantine Vasil

unread,
Oct 4, 2011, 6:56:37 PM10/4/11
to google-docum...@googlegroups.com
I have an AppEngine Python App and want to upload a file to Google Docs directly
in my HTML5 front end using a HTTP POST request to the resumable-create-media link of the resources feed. To acquire this link, my Python app will request https://docs.google.com/feeds/default/private/full,
get the link [resumable-create-media link] like https://docs.google.com/feeds/upload/create-session/default/private/full and use it like this:

POST [resumable-create-media link]
Content-Length: 0
X
-Upload-Content-Type: application/pdf
X
-Upload-Content-Length: 1073741824

as documented here:

HTML5 supports CORS, the question is if Google Docs supports CORS too?
e.g. does it return the CORS enabled header:
Access-Control-Allow-Origin: *

Cross Origin Resource Sharing (CORS)
CORS allows web applications on one domain to make cross domain AJAX requests to another domain. It's dead simple to enable, only requiring a single response header to be sent by the server.

Thank you in advance,
--Constantine





Vic Fryzel

unread,
Oct 4, 2011, 8:44:22 PM10/4/11
to google-docum...@googlegroups.com
I don't think we send back the required header.  We'll see about adding this for you.

-Vic

Constantine Vasil

unread,
Oct 4, 2011, 11:02:12 PM10/4/11
to google-docum...@googlegroups.com
Hi Vic,

This would be great if you do it! so GDocs will work with HTML5!

Thank you,
--Constantine

Michiel de Jong

unread,
Nov 17, 2011, 8:13:35 AM11/17/11
to Google Documents List API
i agree this would be awesome. at the unhosted project we promote
"instant data liberation" to make APIs more accessible on the open
web, and this is exactly the sort of thing we need!

as soon as the user-agent has the access token, there is no reason to
deny html5 apps access to the resources, and most browsers now support
CORS headers, so if you're not adding them where appropriate, you're
basically lagging behind in compliance with open web standards. sadly,
lots of people still are, so i'm very happy to see that google is
taking the lead once more in open web tech awesomeness, and you are
picking this up in your API interfaces!


On Oct 5, 1:44 am, Vic Fryzel <vicfry...@google.com> wrote:
> I don't think we send back the required header.  We'll see about adding this
> for you.
>
> -Vic
>
> On Tue, Oct 4, 2011 at 3:56 PM, Constantine Vasil <thst...@gmail.com> wrote:
> > as documented here:
> >http://code.google.com/intl/fr/apis/documents/docs/3.0/developers_gui...
> > HTML5 supports CORS, the question is if Google Docs supports CORS too?
> > e.g. does it return the CORS enabled header:
> > Access-Control-Allow-Origin: *

any news on this since that conversation? is there a ticket we can
track?

thanks so much for making your API more open and more "webby" in this
way!


Cheers,
Michiel de Jong
Unhosted.org

Michiel de Jong

unread,
Mar 11, 2012, 8:14:38 AM3/11/12
to google-docum...@googlegroups.com
Hi! any update on this?

cheers!
Michiel
Reply all
Reply to author
Forward
0 new messages