-
-
Notifications
You must be signed in to change notification settings - Fork 206
How to solve CORS restriction? #490
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
Comments
Normally, http headers are not case sensitive (I think), but for my self hosted (kubernetes) parse server, I am pretty sure, I had to specify |
Thanks @fischerscode ! i just tried your suggestion but it still returned the same error. |
@gorillatapstudio |
yes, the error is little bit different. The second line (FetchEvent Type Error) is new.
|
Did you remove |
No, i didn't. the config is still as follows but whatever I set up there seems no effect. I tried several apps at b4a i have but it does not work.
|
I have figured that part out... The typo was also in my server config. |
So your setting is definitely not used by the server. So for now, you should be fine using this branch. parse_server_sdk_flutter:
git:
url: git://github.com/fischerscode/Parse-SDK-Flutter.git
ref: issue-490
path: packages/flutter |
Thanks for the fix! however it still does not work. The error is similar to before. I believe the installation-id is used when log in / sign up / and facebook log in happens. So it seems the main reason might be the option is not actually applied to the b4a parse server.
|
@gorillatapstudio |
@fischerscode so sorry but it still does not work showing the same error. |
@gorillatapstudio |
@fischerscode thank you so much! i actually didn't run pub get! totally my fault. it's working now! thanks a million! |
@fischerscode is it possible to apply this fix to a release based on non-DIO version? Now I am having a hard choice between performance and login feature. |
@gorillatapstudio |
@fischerscode thanks for the fix. I set doNotSendInstallationID = true to login, signup and loginwith("facebook", ...) and all three functions worked! |
Welllll And it was supposed to be published by end of this month. I hate it. @fischerscode Thanks so much will use your branch! |
We are closing issues that have been open for a long time without activity. |
I followed all the guidelines and spent a lot of time debugging but I still received the CORS error when tried to use parse log in / sign up, although other features work fine. I am using B4a 3.10 as parse server, tried both 1.7, 1.8, and 2.0 flutter Parse SDK. Example at https://artisse.us
@phillwiggins do you happen to have a working sample at b4a so that i can start from there? thanks!
Error:
Access to XMLHttpRequest at 'http://dogorcat.back4app.io/login?username=g%40gmail.com&password=g' from origin 'http://localhost:49255' has been blocked by CORS policy: Request header field x-parse-installation-id is not allowed by Access-Control-Allow-Headers in preflight response.
In b4a parse server option I have added:
{ "allowHeaders": [ "X-Parse-Installation-Id" ] }
.
My code to init parse is:
final coreStore = await CoreStoreSharedPrefsImp.getInstance(); await Parse().initialize( _resources.parseApplicationId, " _resources.parseServerUrl, //tried both 'https://parseapi.back4app.com/' or 'https://artisse.back4app.io' clientKey: _resources.parseClientKey, autoSendSessionId: true, debug: false, coreStore: coreStore, appName: kIsWeb ? _resources.appDisplayName : null, appVersion: kIsWeb ? "Version 1" : null, appPackageName: kIsWeb ? "dog" : null, // );
The text was updated successfully, but these errors were encountered: