Skip to content

Commit

Permalink
fix: fix error proxy header.
Browse files Browse the repository at this point in the history
  • Loading branch information
hezhengxu2018 committed Jun 1, 2024
1 parent a849046 commit 1464bfe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 2 additions & 1 deletion app/core/service/ProxyCacheService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,8 @@ export class ProxyCacheService extends AbstractService {
compressed: true,
...options,
headers: {
...ctx.headers,
accept: ctx.header?.accept,
'user-agent': ctx.header?.['user-agent'],
authorization,
'x-forwarded-for': ctx?.ip,
via: `1.1, ${this.config.cnpmcore.registry}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,6 @@ describe('test/port/controller/package/DownloadPackageVersionTarController.test.
.get('/foobar/-/foobar-1.0.0.tgz')
.set('user-agent', publisher.ua + ' node/16.0.0')
.set('Accept', 'application/vnd.npm.install-v1+json');
console.log(res.status);
assert(res.status === 200);
// run in background
await setTimeout(1000);
Expand Down

0 comments on commit 1464bfe

Please sign in to comment.