Skip to content

Commit

Permalink
refactor: allow exclude user agent using null value
Browse files Browse the repository at this point in the history
Signed-off-by: primewalkervn <primewalkervn@gmail.com>
  • Loading branch information
PrimeWalkerVN committed Jan 10, 2024
1 parent 8b3320d commit da2f6d9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/request.js
Expand Up @@ -274,8 +274,11 @@ export const getNodeRequestOptions = request => {
}

// HTTP-network-or-cache fetch step 2.11
// > If request's user-agent is null, excluding user-agent in request's header list
if (!headers.has('User-Agent')) {
headers.set('User-Agent', 'node-fetch');
}else if (headers.get('User-Agent') === 'null') {
headers.delete('User-Agent')
}

// HTTP-network-or-cache fetch step 2.15
Expand Down

0 comments on commit da2f6d9

Please sign in to comment.