mirror of
https://github.com/pnpm/pnpm.git
synced 2026-04-11 10:40:53 -04:00
fix: improve the performance of searching for auth tokens (#6717)
This commit is contained in:
6
.changeset/dirty-bottles-hug.md
Normal file
6
.changeset/dirty-bottles-hug.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@pnpm/network.auth-header": patch
|
||||
"pnpm": patch
|
||||
---
|
||||
|
||||
Improve the performance of searching for auth tokens.
|
||||
@@ -40,6 +40,6 @@ function getAuthHeaderByURI (authHeaders: Record<string, string>, maxParts: numb
|
||||
function removePort (originalUrl: string) {
|
||||
const urlObj = new URL(originalUrl)
|
||||
if (urlObj.port === '') return originalUrl
|
||||
const newUrlObj = new URL(`${urlObj.protocol}//${urlObj.hostname}${urlObj.pathname}${urlObj.search}${urlObj.hash}`)
|
||||
return newUrlObj.toString()
|
||||
urlObj.port = ''
|
||||
return urlObj.toString()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user