Skip to content

Commit

Permalink
Merge pull request #5 from logto-io/charles-sync-from-upstream
Browse files Browse the repository at this point in the history
chore: update from upstream
  • Loading branch information
charIeszhao authored Jan 23, 2025
2 parents de2d8fd + e0cf4d0 commit 046d11f
Show file tree
Hide file tree
Showing 6 changed files with 1,004 additions and 434 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [8.6.1](https://github.com/panva/node-oidc-provider/compare/v8.6.0...v8.6.1) (2025-01-19)


### Fixes

* allow specifying the user-agent header for outgoing requests ([#1287](https://github.com/panva/node-oidc-provider/issues/1287)) ([c77513c](https://github.com/panva/node-oidc-provider/commit/c77513ca44115661f96fb2ae200c194966d76aca))

## [8.6.0](https://github.com/panva/node-oidc-provider/compare/v8.5.3...v8.6.0) (2024-11-21)


Expand Down
5 changes: 3 additions & 2 deletions lib/helpers/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export default async function request(options) {
signal = AbortSignal.timeout(2500),
agent = options.url.protocol === 'http:' ? http.globalAgent : https.globalAgent,
dnsLookup = dns.lookup,
'user-agent': userAgent = undefined,
} = instance(this).configuration('httpOptions')(new URL(options.url));
const helperOptions = pickBy({ signal, agent, dnsLookup }, Boolean);

Expand All @@ -34,12 +35,12 @@ export default async function request(options) {
throw new TypeError('"dnsLookup" http request option must be a function');
}

if (helperOptions['user-agent'] !== undefined && typeof helperOptions['user-agent'] !== 'string') {
if (userAgent !== undefined && typeof userAgent !== 'string') {
throw new TypeError('"user-agent" http request option must be a string');
}

// eslint-disable-next-line no-param-reassign
options.headers['user-agent'] = helperOptions['user-agent'];
options.headers['user-agent'] = userAgent;

return got({
...options,
Expand Down
Loading

0 comments on commit 046d11f

Please sign in to comment.