Skip to content

Comment doesn't apply. This is the cleanest way#21456

Open
patrickhuie19 wants to merge 1 commit intodevelopfrom
chore/gateway-minor-cors
Open

Comment doesn't apply. This is the cleanest way#21456
patrickhuie19 wants to merge 1 commit intodevelopfrom
chore/gateway-minor-cors

Conversation

@patrickhuie19
Copy link
Contributor

I got sucked down a rabbit hole here, but after trying a few different ways of doing this, the current code is the most readable. You can write an allowedOrigins struct, then use path.Match to match the host and ParseRequestURI to validate the CORs domains at deploy time but that requires the readers to know the details of those APIs.

		// check for wildcard host match (e.g., *.remix.com)
		if strings.HasPrefix(allowedHost, "*.") {
			allowedHost = allowedHost[2:]

is a lot more readable than the permutations I tried.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 9, 2026

👋 patrickhuie19, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

@github-actions
Copy link
Contributor

github-actions bot commented Mar 9, 2026

I see you updated files related to core. Please run make gocs in the root directory to add a changeset as well as in the text include at least one of the following tags:

  • #added For any new functionality added.
  • #breaking_change For any functionality that requires manual action for the node to boot.
  • #bugfix For bug fixes.
  • #changed For any change to the existing functionality.
  • #db_update For any feature that introduces updates to database schema.
  • #deprecation_notice For any upcoming deprecation functionality.
  • #internal For changesets that need to be excluded from the final changelog.
  • #nops For any feature that is NOP facing and needs to be in the official Release Notes for the release.
  • #removed For any functionality/config that is removed.
  • #updated For any functionality that is updated.
  • #wip For any change that is not ready yet and external communication about it should be held off till it is feature complete.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 9, 2026

✅ No conflicts with other open PRs targeting develop

@cl-sonarqube-production
Copy link

Quality Gate passed Quality Gate passed

Issues
0 New issues
1 Fixed issue
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

@trunk-io
Copy link

trunk-io bot commented Mar 9, 2026

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

@patrickhuie19 patrickhuie19 requested review from bolekk and jmank88 March 10, 2026 05:15
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.

3 participants