Skip to content

Commit

Permalink
Merge pull request #568 from pmcelhaney/renovate/koa-2.x
Browse files Browse the repository at this point in the history
Update dependency @types/koa to v2.13.10
  • Loading branch information
pmcelhaney authored Oct 24, 2023
2 parents 84f791d + 5c400ee commit f01005b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"@testing-library/dom": "9.3.3",
"@types/jest": "29.5.6",
"@types/js-yaml": "4.0.8",
"@types/koa": "2.13.8",
"@types/koa": "2.13.10",
"@types/koa-bodyparser": "4.3.11",
"@types/koa-proxy": "1.0.6",
"@types/koa-static": "4.0.3",
Expand Down
3 changes: 3 additions & 0 deletions src/server/koa-middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@ export function koaMiddleware(
): Koa.Middleware {
// eslint-disable-next-line max-statements
return async function middleware(ctx, next) {
/* @ts-expect-error the body comes from koa-bodyparser, not sure how to fix this */
const { body, headers, path, query } = ctx.request;

// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
const method = ctx.request.method as HttpMethods;

if (proxyEnabled && proxyUrl) {
/* @ts-expect-error the body comes from koa-bodyparser, not sure how to fix this */
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return proxy({ host: proxyUrl })(ctx, next);
}
Expand All @@ -49,6 +51,7 @@ export function koaMiddleware(
}

const response = await dispatcher.request({
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
body,
/* @ts-expect-error the value of a header can be an array and we don't have a solution for that yet */
headers,
Expand Down
16 changes: 15 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2552,7 +2552,7 @@
"@types/koa" "*"
"@types/koa-send" "*"

"@types/koa@*", "@types/[email protected]":
"@types/koa@*":
version "2.13.8"
resolved "https://registry.yarnpkg.com/@types/koa/-/koa-2.13.8.tgz#4302d2f2712348aadb6c0b03eb614f30afde486b"
integrity sha512-Ugmxmgk/yPRW3ptBTh9VjOLwsKWJuGbymo1uGX0qdaqqL18uJiiG1ZoV0rxCOYSaDGhvEp5Ece02Amx0iwaxQQ==
Expand All @@ -2566,6 +2566,20 @@
"@types/koa-compose" "*"
"@types/node" "*"

"@types/[email protected]":
version "2.13.10"
resolved "https://registry.yarnpkg.com/@types/koa/-/koa-2.13.10.tgz#2c2a1cdf1252d654b05f444194328a3d23a880c4"
integrity sha512-weKc5IBeORLDGwD1FMgPjaZIg0/mtP7KxXAXEzPRCN78k274D9U2acmccDNPL1MwyV40Jj+hQQ5N2eaV6O0z8g==
dependencies:
"@types/accepts" "*"
"@types/content-disposition" "*"
"@types/cookies" "*"
"@types/http-assert" "*"
"@types/http-errors" "*"
"@types/keygrip" "*"
"@types/koa-compose" "*"
"@types/node" "*"

"@types/koa@^2.13.9":
version "2.13.9"
resolved "https://registry.yarnpkg.com/@types/koa/-/koa-2.13.9.tgz#8d989ac17d7f033475fbe34c4f906c9287c2041a"
Expand Down

0 comments on commit f01005b

Please sign in to comment.