-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CORS (Cross-origin resource sharing) not supported by cloud-function-python #48
Comments
This seems to be a bug - does the same thing happen in GET requests? |
No this is not a Making Cross-Domain Requests with CORS First But the file http.py, seems to have initialised the Here's the
|
@MartinSahlen Can you help with this? I seem to be stuck, commenting the |
@MartinSahlen Will this work? A Python package for dealing with HTTP requests and same-origin policie |
@MartinSahlen As you have written the main code here for the |
Tried to solve the CORS issue using So tried versions of |
@MartinSahlen Looks like only you can help me. Please can you? |
Hey! Unfortunately I do not have a lot of free time on my hands to investigate all of these issues, and at the moment the status of the library is very alpha, ie it “works on my machine”. I really am sorry to hear about all the issues you’re having though. I will try to carve out some time in the next week to help you out. In the meantime, you’re doing a (unfortunately for you) lot of good investigation so it’s easier to know where to start looking. |
@MartinSahlen I like to be optimistic. It's really nice that you have carved out so much of time to implement this Functionality I want to run on the I want the function to be called from the browser. I am doing my best to figure out how you actually done this, to correct things on my own. I DO NEED YOUR HELP BADLY, MORE THAN YOU KNOW😅 |
@MartinSahlen Non of the version of the
I had a silly guess that memory of 256MB |
@MartinSahlen
I had to add
to fix it I guess I just have to a similar import for this, before building cloud function python
|
I added
which did take care of the Now I'm getting this error
I tried importing the module in all which ways mentioned but same I guess the entire structure of |
This is my
This is my
This is my POSTMAN result This is the logs on the I have ran out of options I really need this thing working. |
If you want to Allow all HTTP methods request to your google cloud function from the front end and face an issue with CORS. The Following template must work. It worked for me.
|
On
POSTMAN
the cloud function is working as expected.Only when the cloud function URL is called from a browser I'm getting this error in the logs.
This is my function.py file content
On the browser logs the error is being shown as a
500
error in the 'OPTIONS'Browser is sending a
req.method
asOPTIONS
but we have no body present in thisreq
but function is expecting abody
insidereq.method
.What's the work around for this?
The text was updated successfully, but these errors were encountered: