Skip to content

Commit

Permalink
do not pass through host header
Browse files Browse the repository at this point in the history
  • Loading branch information
devinivy committed Oct 12, 2023
1 parent 83f6784 commit f984d2d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/xrpc-server/src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import {
InternalServerError,
Options,
XRPCError,
XRPCReqContext,
HandlerPassthru,
UpstreamFailureError,
UpstreamTimeoutError,
Expand Down Expand Up @@ -301,6 +300,7 @@ export async function proxy(
headers[name] = Array.isArray(value) ? value.join(', ') : value
}
}
delete headers['host']
if (opts?.headers) {
for (const [name, value] of Object.entries(opts.headers)) {
headers[name.toLowerCase()] = value
Expand Down
2 changes: 1 addition & 1 deletion packages/xrpc-server/tests/proxy.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as http from 'http'
import getPort from 'get-port'
import { wait } from '@atproto/common'
import xrpc, { ServiceClient } from '@atproto/xrpc'
import { createServer, closeServer } from './_util'
import * as xrpcServer from '../src'
Expand All @@ -9,7 +10,6 @@ import { gzipSync } from 'zlib'
import { cidForCbor } from '@atproto/common'
import { XRPCError } from '@atproto/xrpc'
import assert from 'assert'
import { wait } from '@atproto/common'

const LEXICONS = [
{
Expand Down

0 comments on commit f984d2d

Please sign in to comment.