Skip to content

CORS issue when running the firenotes example #819

Closed

Description

@paktree

In which file did you encounter the issue?

python-docs-samples/appengine/standard/firebase/firenotes/

Did you change the file? If so, how?

I followed the instruction on the firenotes page to deploy the app to app engine

Describe the issue

When It's trying to save the note, it throws the following error in the browser console:

Failed to load resource: the server responded with a status of 500 ()
my-prototype.appspot.com/:1 XMLHttpRequest cannot load https://backend-dot-my-prototype.appspot.com/notes. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://my-prototype.appspot.com' is therefore not allowed access. The response had HTTP status code 500.

Any help would be appreciated.

Activity

  1. theacodes commented on Feb 22, 2017

    @theacodes
    Contributor

    @paktree can you try using backend.my-prototype.appspot.com instead?

  2. paktree commented on Feb 22, 2017

    @paktree
    Author

    @jonparrott. Ah, that makes sense. I'll give it a try, thanks!

  3. theacodes commented on Feb 22, 2017

    @theacodes
    Contributor

    Let me know. It probably wouldn't kill us to add CORS headers to the backend anyway.

  4. paktree commented on Feb 23, 2017

    @paktree
    Author

    @jonparrott no luck on that, I'm getting some certificate error after changing -dot- to "."

    I found a SO that looks like -dot- is intended to get around the certificate issue: http://stackoverflow.com/questions/10283628/appengine-how-to-not-get-a-certificate-warning-with-backend-secure-connection

    How do I add CORS headers to the backend? Or there is something I am missing?

  5. self-assigned this
    on Feb 24, 2017
  6. paktree commented on Feb 24, 2017

    @paktree
    Author

    Just want to update this thread. After looking at the log, the CORS was not the culprit that causing this to fail. After starting from fresh, I was able to get it working. I may have run the pip install packages at the wrong directory and causing some missing libraries. But it's not obvious to catch at all.

    Thanks!

  7. ryanmats commented on Feb 24, 2017

    @ryanmats
    Contributor

    @paktree great, thanks for the update. Let us know if you have any other questions or comments about the code samples!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions