From 17dd03d84555b322eb5e24d3974aa47bd7929b36 Mon Sep 17 00:00:00 2001 From: will Farrell Date: Wed, 16 Oct 2024 12:09:18 -0600 Subject: [PATCH] fix: remove rawHaders --- packages/http-header-normalizer/index.js | 6 +++--- website/docs/middlewares/http-header-normalizer.md | 2 -- website/docs/upgrade/5-6.md | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/http-header-normalizer/index.js b/packages/http-header-normalizer/index.js index 37e171c5f..3cee2189d 100644 --- a/packages/http-header-normalizer/index.js +++ b/packages/http-header-normalizer/index.js @@ -67,17 +67,17 @@ const httpHeaderNormalizerMiddleware = (opts = {}) => { const httpHeaderNormalizerMiddlewareBefore = async (request) => { if (request.event.headers) { - const rawHeaders = {} + // const rawHeaders = {} const headers = { ...defaultHeaders } for (const key of Object.keys(request.event.headers)) { - rawHeaders[key] = request.event.headers[key] + // rawHeaders[key] = request.event.headers[key] headers[options.normalizeHeaderKey(key, options.canonical)] = request.event.headers[key] } request.event.headers = headers - request.event.rawHeaders = rawHeaders + // request.event.rawHeaders = rawHeaders } if (request.event.multiValueHeaders) { diff --git a/website/docs/middlewares/http-header-normalizer.md b/website/docs/middlewares/http-header-normalizer.md index 9060eec58..d383fff7b 100644 --- a/website/docs/middlewares/http-header-normalizer.md +++ b/website/docs/middlewares/http-header-normalizer.md @@ -13,8 +13,6 @@ Other middlewares like [`jsonBodyParser`](#jsonbodyparser) or [`urlEncodeBodyPar will rely on headers to be one of the normalized formats, so if you want to support non-normalized headers in your app you have to use this middleware before those ones. -This middleware will copy the original headers in `event.rawHeaders`. - ## Install To install this middleware you can use NPM: diff --git a/website/docs/upgrade/5-6.md b/website/docs/upgrade/5-6.md index 6fafcef69..e42daa60f 100644 --- a/website/docs/upgrade/5-6.md +++ b/website/docs/upgrade/5-6.md @@ -63,7 +63,7 @@ No change ### [http-header-normalizer](/docs/middlewares/http-header-normalizer) -No change +- `rawHeaders` is no longer attached to `event`. **Breaking Change** ### [http-json-body-parser](/docs/middlewares/http-json-body-parser)