Comments (11)
@Lukasa any insights here?
from swift-nio.
I'm fine with us changing some cases of .unlikely
to .yes
where we can find an RFC validating the behaviour.
The issue I suspect @helje5 is mostly bothered by is the word choice. That's fair enough, .unlikely
doesn't convey the meaning very well here. The purpose of this field is to decide what transport header rewriting we do, and how that affects framing. In this context, .unlikely
means "don't rewrite the headers, let the user make their own bed and lie in it". Put another way, it's the "I don't know" case. We can change the word .unlikely
to .unknown
if we want whenever we want, the enum is private.
For that matter, if there are RFCs that cover the body requirements for non-HTTP/1.1 methods that we can point to that justify changing .unlikely
to either .yes
or .no
we can also do that whenever we want, as the behavioural change constitutes a bug fix. This isn't a 2.0 issue.
from swift-nio.
If we tie the HTTPMethod to specific methods anyways, there is actually no reason for .unknown
? We can just add the proper values for every single method (PROPFIND, MKCALENDAR etc. - work, but should be done).
This may make .unlikely
legit. it is fine for e.g. .GET
, but the wrong option for the fallthrough. The fallthrough should be .yes
(I think)?
from swift-nio.
@Lukasa the enums are public
public enum HTTPMethod: Equatable {
public enum HasBody {
case yes
case no
case unlikely
}
case GET
case PUT
case ACL
case HEAD
case POST
case COPY
case LOCK
case MOVE
case BIND
case LINK
case PATCH
case TRACE
case MKCOL
case MERGE
case PURGE
case NOTIFY
case SEARCH
case UNLOCK
case REBIND
case UNBIND
case REPORT
case DELETE
case UNLINK
case CONNECT
case MSEARCH
case OPTIONS
case PROPFIND
case CHECKOUT
case PROPPATCH
case SUBSCRIBE
case MKCALENDAR
case MKACTIVITY
case UNSUBSCRIBE
case RAW(value: String)
}
from swift-nio.
@weissi I'm losing my mind in my old age
from swift-nio.
@helje5 The problem with having .yes
in the fallthrough
is that it will cause SwiftNIO to put a Transfer-Encoding
header on the request unconditionally if there are no other transport headers in place. That seems like the wrong default for methods we don't understand: they may have the semantics of GET, but we don't know that, and adding TE may get a valid request rejected. .unlikely
seems like the right default for the fallthrough
: I think we should just expand the switch
to be more accurate more of the time.
from swift-nio.
we'll make this internal
from swift-nio.
@Lukasa eek, my dashboard didn't show this as it was missing the '
So we could make this internal now and probably not break anybody.
@Lukasa what do you think?
from swift-nio.
Let’s do it.
from swift-nio.
@Lukasa done
from swift-nio.
@weissi sounds good
from swift-nio.
Related Issues (20)
- FB‘,-(CI HOT 1
- ✓ HOT 1
- Proposal: Contributing HTTP Response Status Code Mappings HOT 2
- Performance tests broken (always paste a result from 3rd Jan, actual run fails) HOT 7
- TCPThroughputBenchmark has a crashing race
- NIOFileSystem uses yet another thread pool instead of NIOThreadPool HOT 3
- NIOFileSystem's BufferedWriter wants Sequence<UInt8>s and doesn't accept ByteBuffers
- NIOFileSystem's BufferedWriter produces empty files when they shouldn't be empty HOT 1
- NIOFileSystem: Should offer withTemporaryDirectory
- NIOFileSystem: BufferedReader.read(while:) doesn't say if it stopped reading because the condition was met or because or EOF HOT 1
- NIOFileSystem: BufferedReader can only return `[UInt8]` and not `ByteBuffer` HOT 2
- `NIOFileSystem` module needs to be `_NIOFileSystem`
- Occasional program crashes on ubuntu20.04 HOT 2
- When my app is submitted to the App Store, an error occurs The naming convention for 'NlOBase64 'is incorrect HOT 7
- Allocation counter tests don't work on macOS HOT 1
- Add `NIOBSDSocket.Option` for `SO_BROADCAST`
- Add way to differentiate between websocket upgrade failing and not attempting an upgrade HOT 1
- Thread running at User-interactive quality-of-service class waiting on a lower QoS thread running at Default quality-of-service class. HOT 2
- Add Channel.cancelOnClose(_:)
- Not working on iPadOS 17.4.1 HOT 1
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 swift-nio.