Skip to content

Commit

Permalink
docs: Fix citations to RFC 8089 (not 8909) for file: url (#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
rotu authored Sep 5, 2023
1 parent 9576bde commit 26705c5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

### ⚠️ BREAKING CHANGES

* the strict RFC 8909 mode has been removed
* the strict RFC 8089 mode has been removed
* support for node 14 has been removed

### Bug Fixes
Expand Down
6 changes: 3 additions & 3 deletions lib/npa.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ function fromFile (res, where) {
resolvedUrl = new url.URL(rawWithPrefix, `file://${path.resolve(where)}/`)
specUrl = new url.URL(rawWithPrefix)
} catch (originalError) {
const er = new Error('Invalid file: URL, must comply with RFC 8909')
const er = new Error('Invalid file: URL, must comply with RFC 8089')
throw Object.assign(er, {
raw: res.rawSpec,
spec: res,
Expand All @@ -257,7 +257,7 @@ function fromFile (res, where) {
})
}

// XXX backwards compatibility lack of compliance with RFC 8909
// XXX backwards compatibility lack of compliance with RFC 8089
if (resolvedUrl.host && resolvedUrl.host !== 'localhost') {
const rawSpec = res.rawSpec.replace(/^file:\/\//, 'file:///')
resolvedUrl = new url.URL(rawSpec, `file://${path.resolve(where)}/`)
Expand All @@ -273,7 +273,7 @@ function fromFile (res, where) {
specUrl = new url.URL(rawSpec)
rawNoPrefix = rawSpec.replace(/^file:/, '')
}
// XXX end RFC 8909 violation backwards compatibility section
// XXX end RFC 8089 violation backwards compatibility section

// turn /C:/blah into just C:/blah on windows
let specPath = decodeURIComponent(specUrl.pathname)
Expand Down

0 comments on commit 26705c5

Please sign in to comment.