Skip to content
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

Problems with POST on Firebase #445

Open
PeWu opened this issue Dec 1, 2022 · 5 comments
Open

Problems with POST on Firebase #445

PeWu opened this issue Dec 1, 2022 · 5 comments

Comments

@PeWu
Copy link

PeWu commented Dec 1, 2022

I don't know if this is a cors-anywhere, cors-server or Firebase issue.

I'm trying to set up a proxy on Firebase using https://github.com/isoaxe/cors-server and I'm having trouble proxying POST requests. The main goal is to make my project (https://pewu.github.io/topola-viewer/) work again with a new proxy after Heroku free tier has been turned down.

Here is what I was able to destil using cors-server running on Firebase.

This works:

curl -H "Content-Type: application/json" -X POST https://postman-echo.com/post -d test

This works:

curl https://proxy-m4bvvb54la-uc.a.run.app/https://postman-echo.com/post  -H "Origin: http://localhost:3000" -X POST

This doesn't work:

curl https://proxy-m4bvvb54la-uc.a.run.app/https://postman-echo.com/post  -H "Origin: http://localhost:3000" -X POST -d test

Stops working after adding -d test

Log in Firebase:

The request has been terminated because it has reached the maximum request timeout. To change this limit, see https://cloud.google.com/run/docs/configuring/request-timeout

Just from this log it's not possible to deduce whether the timeout was caused by cors-anywhere, cors-server or Firebase. I don't expect postman-echo.com to time out. Anyway, the problem appears not only with postman-echo.com.

@camilohr18
Copy link

hi @PeWu, did you find any solution?? I have same problem.

@PeWu
Copy link
Author

PeWu commented Aug 22, 2023

Not really. My solution was to not use Firebase.

@camilohr18
Copy link

and by any chance may I know wich one did you use?? and how did you configure it?? Will help me a lot!!

@PeWu
Copy link
Author

PeWu commented Aug 23, 2023

I'm hosting my cors-anywhere proxy on https://mikr.us/ – this is a Polish hosting service. It costs 35 PLN (around $8.50) per year for a minimal setup. My instance is running at https://topolaproxy.bieda.it/

I only changed the originWhitelist from the original repo. My repo is here: https://github.com/PeWu/cors-server

@camilohr18
Copy link

Thanks for your answer. I think it possible to make the deploy but we are missing something with firebase. I already deploy on render.com and I will check some options on firebase, should work if we modify something on Gcloud, but to my project I will use a pay service for now. If I found something I will let you know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants