Skip to content

Commit

Permalink
add note on origins w/ default port to README.md (#163)
Browse files Browse the repository at this point in the history
* Allow specifying redundant default port in origin

When `http://EXAMPLE:80` is an allowed origin, requests are not allowed from
`http://EXAMPLE`. Since port 80 is the default port for HTTP, browsers
will strip it and thus rack-cors never receives a request from `http://EXAMPLE`.

A similar problem is discussed here: request/request#515

* Remove default port from http(s) without URI#parse

* revert code changes

* add note on origins w/ default port to README.md
  • Loading branch information
nbr authored Jan 8, 2025
1 parent ea21a39 commit c3e6de5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ A Resource path can be specified as exact string match (`/path/to/file.txt`) or

### Origin Matching

When specifying an origin, make sure that it does not have a trailing slash.
* When specifying an origin, make sure that it does not have a trailing slash.

* When specifying an HTTP origin that uses the scheme's default port (e.g. `http://example.test:80`), some clients may not strip the port which could result in unexpected blocked requests (additional context [here](https://github.com/request/request/pull/2904)).

### Testing Postman and/or cURL

Expand Down

0 comments on commit c3e6de5

Please sign in to comment.