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

Upgrade path to regexp #71

Merged
merged 5 commits into from
Apr 9, 2020
Merged

Conversation

Sinewyk
Copy link
Contributor

@Sinewyk Sinewyk commented Apr 8, 2020

Upgrade path-to-regexp from 1.x to ^6.x

then:

should fixes #40

should be a straight upgrade over #70

Maybe breaking change (major semver) related to the encode/decode situation.

@niftylettuce niftylettuce merged commit 92df918 into koajs:master Apr 9, 2020
@niftylettuce
Copy link
Contributor

@Sinewyk Sinewyk deleted the upgrade_path_to_regexp branch April 9, 2020 00:38
@niftylettuce
Copy link
Contributor

Ping @Sinewyk @tigt -- can you resolve/PR?

3imed-jaberi added a commit to 3imed-jaberi/koa-router that referenced this pull request May 28, 2020
ide added a commit to ide/koa-router that referenced this pull request Mar 4, 2021
The main breaking change from v8.x to v9.x was an upgrade to `path-to-regex`. [That PR](koajs#71) alluded to a breaking change in encoding. Namely, parameters were not URL-encoded: parameters with safe special characters (like spaces) were not percent-encoded, and parameters with special characters that mean something in a URL, such as slashes (path separators) and question marks (query string delimiter).

The motivation for this PR is to make URL-encoding be the default since typically the parameters provided to `Router.url` are plain, unencoded values. Should someone need an escape hatch, they could pass in `{ encode: null }` (I think) to disable the automatic encoding.

Updated tests, docs, and the changelog.
ide added a commit to ide/koa-router that referenced this pull request Jul 18, 2022
The main breaking change from v8.x to v9.x was an upgrade to `path-to-regex`. [That PR](koajs#71) alluded to a breaking change in encoding. Namely, parameters were not URL-encoded: parameters with safe special characters (like spaces) were not percent-encoded, and parameters with special characters that mean something in a URL, such as slashes (path separators) and question marks (query string delimiter).

The motivation for this PR is to make URL-encoding be the default since typically the parameters provided to `Router.url` are plain, unencoded values. Should someone need an escape hatch, they could pass in `{ encode: null }` (I think) to disable the automatic encoding.

Updated tests and docs.
titanism pushed a commit that referenced this pull request Jul 19, 2022
The main breaking change from v8.x to v9.x was an upgrade to `path-to-regex`. [That PR](#71) alluded to a breaking change in encoding. Namely, parameters were not URL-encoded: parameters with safe special characters (like spaces) were not percent-encoded, and parameters with special characters that mean something in a URL, such as slashes (path separators) and question marks (query string delimiter).

The motivation for this PR is to make URL-encoding be the default since typically the parameters provided to `Router.url` are plain, unencoded values. Should someone need an escape hatch, they could pass in `{ encode: null }` (I think) to disable the automatic encoding.

Updated tests and docs.
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.

Routing does not handle optional route parameter with prefix
2 participants