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

fix(cors): set url with chrome-extension:// as regex origin #499

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

istudyatuni
Copy link

@istudyatuni istudyatuni commented Feb 2, 2025

Fix #498


Important

Modify cors() in cors.rs to handle Chrome extension URLs as regex origins and add error logging.

  • Behavior:
    • Modify cors() in cors.rs to handle Chrome extension URLs as regex origins instead of exact origins.
    • Filters config.cors to separate Chrome extension URLs into allowed_regex_origins.
    • Adds error logging for CORS setup failures.
  • Constants:
    • Introduces CHROME_EXTENSION_PREFIX for identifying Chrome extension URLs.

This description was created by Ellipsis for 8adbf9d. It will automatically update as commits are pushed.

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Reviewed everything up to 8adbf9d in 55 seconds

More details
  • Looked at 48 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. aw-server/src/endpoints/cors.rs:15
  • Draft comment:
    Unnecessary clone() on config.cors. Use iter() instead of clone().into_iter() to avoid cloning the vector unnecessarily. This applies to lines 15 and 37.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The use of clone() on config.cors is unnecessary since into_iter() is called immediately after, which takes ownership of the vector. This can be optimized by removing the clone() call.

Workflow ID: wflow_ouafDXkd07uEHSkW


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

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.

Support configuring additional allowed origins
1 participant