mtrudel / bandit

Bandit is a pure Elixir HTTP server for Plug & WebSock applications
MIT License
1.68k stars 82 forks source link

(Bandit.HTTPError) Request line HTTP error #407

Open stocks29 opened 6 days ago

stocks29 commented 6 days ago

In my phoenix app which uses Bandit, I'm using bling to process stripe webhooks and the stripe cli to forward webhooks to my local server.

Some of the webhook requests fail but some are successful. Here are the errors I'm seeing:

[info] Sent 200 in 11ms
[error] ** (Bandit.HTTPError) Request line HTTP error: "{\n"
[info] POST /webhooks/stripe
[info] Sent 200 in 3ms
[error] ** (Bandit.HTTPError) Request line HTTP error: " \"description\": \"Subscription creation\",\n"
[info] POST /webhooks/stripe
[info] Sent 200 in 8ms
[error] ** (Bandit.HTTPError) Request line HTTP error: "ll,\n"
[info] POST /webhooks/stripe
[info] Sent 200 in 370µs
[error] ** (Bandit.HTTPError) Request line HTTP error: " null,\n"

I switched from Bandit to cowboy and the errors are no longer occurring. I'm not sure what the problem is, but it seems to be specific to Bandit.

mtrudel commented 4 days ago

You're almost certainly dropping a conn rebind somewhere; check out the background in https://github.com/mtrudel/bandit/issues/361.

stocks29 commented 3 days ago

Thanks @mtrudel, I'll take a look at the bling library and see if there is a conn rebind missing somewhere.