Skip to content

Requests with a body don't work #417

Closed
@SoulKa

Description

@SoulKa

Is this a bug report?

Yes

Steps to reproduce

  1. Setup the project as written in the readme
  2. Create an endpoint to check if the request succeeds (mine is on https://webhook.site)
  3. Execute a request with no body (using postman) => succeeds
  4. Execute the same request with a body (using postman) => timeout/ no response

The request:
http://127.0.0.1/proxy/MY-WEBHOOK-IDENTIFIER

Expected behavior

forward http://127.0.0.1/proxy/MY-WEBHOOK-IDENTIFIER to https://webhook.site/MY-WEBHOOK-IDENTIFIER no matter what content:

No timeout when requesting on http://127.0.0.1/proxy/MY-WEBHOOK-IDENTIFIER with a content
No timeout when requesting on http://127.0.0.1/proxy/MY-WEBHOOK-IDENTIFIER with no content
No timeout when requesting on https://webhook.site/MY-WEBHOOK-IDENTIFIER with or without content

Actual behavior

Timeout when requesting on http://127.0.0.1/proxy/MY-WEBHOOK-IDENTIFIER with a content
No timeout when requesting on http://127.0.0.1/proxy/MY-WEBHOOK-IDENTIFIER with no content
No timeout when requesting on https://webhook.site/MY-WEBHOOK-IDENTIFIER with or without content

Setup

app.use("/proxy", createProxyMiddleware({ target: "https://webhook.site", pathRewrite: { ["^/proxy"]: "" }, logLevel: "debug", changeOrigin: true }));

  • http-proxy-middleware: 1.0.3
  • http-proxy-middleware configuration: logLevel=debug, changeOrigin=true, pathRewrite={ ["^/proxy"]: "" }
  • server: express + 4.16.3

client info

OS: Linux Mint 19.3 "Tricia"
User-Agent: PostmanRuntime/7.24.0

target server info

Webhook.site: A free web server to mirror incoming requests

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions