Skip to content

Commit

Permalink
Docs: Update cors match regex example: (#2152)
Browse files Browse the repository at this point in the history
fixes #2151

The docs match regex example was wrong, it was missing ^ at the
beginning and $ at the end. `$` marks the end of a string, which could
be a safety issue.
  • Loading branch information
o0Ignition0o authored and garypen committed Nov 30, 2022
1 parent 4554890 commit da1c0fa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions NEXT_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,13 @@ By [@col](https://github.com/col) in https://github.com/apollographql/router/pul
## 🛠 Maintenance
## 📚 Documentation

### Docs: Update cors match regex example ([Issue #2151](https://github.com/apollographql/router/issues/2151))

The docs CORS regex example now displays a working and safe way to allow `HTTPS` subdomains of `api.example.com`.

By [@col](https://github.com/o0Ignition0o) in https://github.com/apollographql/router/pull/2152


### update documentation to reflect new examples structure ([Issue #2095](https://github.com/apollographql/router/pull/2133))

We recently updated the examples directory structure. This fixes the documentation links to the examples. It also makes clear that rhai subgraph fields are read-only, since they are shared resources.
Expand Down
2 changes: 1 addition & 1 deletion docs/source/configuration/cors.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ cors:
- https://www.your-app.example.com
- https://studio.apollographql.com # Keep this so Apollo Studio can run queries against your router
match_origins:
- "https://([a-z0-9]+[.])*api[.]example[.]com" # any host that uses https and ends with .api.example.com
- "^https://([a-z0-9]+[.])*api[.]example[.]com$" # any host that uses https and ends with .api.example.com
```
You can also disable CORS entirely by setting `origins` to an empty list:
Expand Down

0 comments on commit da1c0fa

Please sign in to comment.