[swift-corelibs-dev] SR-6405: URLRequest does not capitalise HTTP methods
stephen.celis at gmail.com
Thu Nov 16 13:14:06 CST 2017
> On Nov 16, 2017, at 2:02 PM, Alex Blewitt <alblue at apple.com> wrote:
> There is a TestFoundation target in the swift-corelibs-foundation project, which can allow the tests to be run against the open source codebase.
Sorry, maybe I wasn’t clear, I was wondering if there’s a test suite that regularly runs against _both_ the open-source Foundation implementation _and_ the closed-source Foundation implementation in order to catch inconsistencies across code bases.
> Note that there's no requirement for the methods to be capitalised in URLRequest. Chances are that the implementation is such that there are some pre-defined values which can be used/replaced for keys, but other ones will take the case of whatever you put in them.
> I also don't think it makes sense to capitalise everything because in most cases it will have no effect, but is wasted computation. So in other words, don't pass lowercase values into the x.httpMethod if you don't want it.
I don’t have a strong enough opinion to argue for or against auto-capitalizing the HTTP method, but I _do_ care for consistency across platforms. We have a significant test suite in our code bases with a lot of unit tests and snapshot tests that pass on our dev machines (Mac), but fail on Linux.
More information about the swift-corelibs-dev