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

backport: Fix RPC cors issue of preflight request #4308

Merged
merged 2 commits into from
Jan 20, 2024

Conversation

chenyukang
Copy link
Collaborator

@chenyukang chenyukang commented Jan 19, 2024

What problem does this PR solve?

Because current default cors setting, if we send request from browser console, we met this issue:

Access to fetch at 'http://127.0.0.1:8114/' from origin 'null' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

Problem Summary:

What is changed and how it works?

  • Add CorsLayer::permissive() for a permissive setting for cors.
  • Add keep-alive by the way, our current setting is set keep-alive when websockets is enabled, we should set it by default.

What's Changed:

Related changes

  • PR to update owner/repo:
  • Need to cherry-pick to the release branch

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code ci-runs-only: [ quick_checks,linters ]

Side effects

  • Performance regression
  • Breaking backward compatibility

Release note

Title Only: Include only the PR title in the release note.

@chenyukang chenyukang requested a review from a team as a code owner January 19, 2024 01:37
@chenyukang chenyukang requested review from doitian and removed request for a team January 19, 2024 01:37
@chenyukang chenyukang changed the base branch from develop to rc/v0.113.x January 19, 2024 01:37
@quake quake merged commit 8efecbc into nervosnetwork:rc/v0.113.x Jan 20, 2024
32 checks passed
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

Successfully merging this pull request may close these issues.

2 participants