Skip to content

Commit

Permalink
feat: add drpc headers forwarding
Browse files Browse the repository at this point in the history
  • Loading branch information
BATMAH69 committed Oct 31, 2024
1 parent 6aa9386 commit 64e0ece
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pages/api/rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,13 @@ export default async function rpc(req: NextApiRequest, res: NextApiResponse) {
)
console.error(mask(err))
}

res.status(requested.status).json(responded)
const { headers } = requested
res
.setHeader('x-drpc-trace-id', headers.get('x-drpc-trace-id') ?? '')
.setHeader('x-drpc-owner-tier', headers.get('x-drpc-owner-tier') ?? '')
.setHeader('x-drpc-date', headers.get('date') ?? '')
.status(requested.status)
.json(responded)

console.info('Request to api/rpc successfully fullfilled', {
...requestInfo,
Expand Down

0 comments on commit 64e0ece

Please sign in to comment.