Comments (3)
Thanks for the quick turnaround on this, will push that to prod now. Shortest-lived fork I have probably ever had to run in prod.
from bandit.
I agonized over this corner of behaviour for awhile when I was working up the first pass at WebSocket support - I've always understood RFC 6455ยง7.4.1 to prescribe 1001 as the appropriate close code for a server going down. The spec is a bit vague on specifics here though, so it's definitely open to interpretation. Let's look at some prior art, noting that 1000 is specified to 'indicate[] a normal closure, meaning that the purpose for which the connection was established has been fulfilled':
- Cowboy uses 1000 for stop and timeout cases. Setting aside the semantics of the timeout case (which is pretty clearly incorrect), it's arguable that a 1000 is correct for the server shutting down.
- The ws library also uses 1000 for the shutdown case
- Autobahn isn't prescriptive one way or the other
The above combined with the inherent vagueness of the spec makes this seem like a bit of a silly hill to die on; I'll be updating Bandit's behaviour to return 1000 in this case shortly.
from bandit.
Fixed in 0.6.8!
from bandit.
Related Issues (20)
- Plug.Conn being created with remote_ip as local? HOT 2
- Unable to turn on compression on http1 adapter HOT 6
- FunctionClauseError) no function clause matching in Bandit.HTTP1.Handler.handle_info/2 HOT 5
- Add support for function plugs HOT 2
- HTTP conformance bug: sends response body on HEAD request HOT 3
- Chunked HTTP1 response piped gets interrupted HOT 2
- Headers being read from uncleared buffer HOT 4
- Improve handling of unread bodies when using keep alive
- plug module does not define init/1 HOT 2
- How to stop Bandit? HOT 2
- LiveView PubSub Subscription Issue HOT 3
- Request line read errors HOT 2
- Request Line Read Error HOT 6
- Disabling HTTP/2 causes client errors HOT 7
- Using Process.send_after or :timer.send_interval generates error after liveview process is dead HOT 1
- Add CHANGELOG to package files HOT 3
- HTTP2 Internal Server Error in send_file HOT 2
- Phoenix Presence error HOT 2
- Add config option to disable WebSocket masking HOT 4
- Hot Code Paths in Rust
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bandit.