Skip to content

Commit

Permalink
fix: 🐛 Fix passing request body to proxy target
Browse files Browse the repository at this point in the history
  • Loading branch information
Hobart2967 committed Oct 1, 2023
1 parent a36e08a commit 530aa26
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import { Logger } from 'winston';
import { WebServer } from './services/web-server.symbol';
import { UuidService } from './services/uuid.service';
import { RequestWithContext } from './models/request-with-context.model';
import { createProxyMiddleware } from 'http-proxy-middleware';
import { createProxyMiddleware, fixRequestBody } from 'http-proxy-middleware';
import { RequestMapper, RequestMapperType } from './models/request-mapper.interface';
import { RequestVerificationService } from './services/request-verification.service';
import { Configuration } from './models/configuration.interface';
import bodyParser from 'body-parser';

@injectable()
export class App {
//#region Ctor
Expand Down Expand Up @@ -68,6 +69,7 @@ export class App {
const proxyMw = createProxyMiddleware({
target: this._config.localStackUri,
changeOrigin: true,
onProxyReq: fixRequestBody,
ws: true
});

Expand Down

0 comments on commit 530aa26

Please sign in to comment.