- 03 Apr, 2018 2 commits
-
-
Kenton Varda authored
Ensure '%' signs get round-tripped in URL path, fragment, userinfo
-
Harris Hancock authored
Our query string encoding function (encodeWwwForm()) was already doing the right thing. I changed the comment in encodeUriPath() to clarify that it's intended to implement a URL class which stores its path in percent-decoded form, not either/or. I was wrong before.
-
- 02 Apr, 2018 6 commits
-
-
Kenton Varda authored
Allow underscores in URL hostnames
-
Harris Hancock authored
We'll need more hostname-related code changes in the future, but for now this will solve a Cloudflare customer's existing bug report.
-
Kenton Varda authored
Distinguish between empty- and null-valued query parameters
-
Harris Hancock authored
-
Kenton Varda authored
Implement various WHATWG URL percent encoding functions
-
Harris Hancock authored
This has the effect of making the authority, path, and fragment components each slightly more permissive in what they don't escape.
-
- 29 Mar, 2018 1 commit
-
-
Harris Hancock authored
According to the WHATWG URL spec, each different component of a URL gets its very own percent encode set, which we've been doing wrong this whole time. In terms of reserved characters, the fragment set is a subset of the path set, which is a subset of the userinfo set, which is a subset of RFC 2396's reserved set.
-
- 23 Mar, 2018 1 commit
-
-
Kenton Varda authored
Make all tests pass on qemu-aarch64
-
- 22 Mar, 2018 3 commits
-
-
Kenton Varda authored
-
Kenton Varda authored
Tested on qemu-aarch64.
-
Kenton Varda authored
It appears that QEMU: - Does not correctly set the MSG_TRUNC flag on recvmsg(). - Crashes when we try to use the IP_PKTINFO ancillary message. So let's skip those tests...
-
- 19 Mar, 2018 3 commits
-
-
Kenton Varda authored
When catching an unknown exception type, at least log the type.
-
Kenton Varda authored
Including cxxabi.h caused build failures because our definition of __cxa_get_globals conflicted with the one in the header (despite being in a different namespace -- apparently becaues of `extern "C"` the compiler considers them to be conflicting). Annoyingly, __cxa_get_globals is only defined by GNU's cxxabi.h and not LLVM's. But LLVM has a nicer __cxa_uncaught_exceptions() that we can perhaps use. Also in C++17 there is a standard function we can call instead.
-
Kenton Varda authored
-
- 15 Mar, 2018 3 commits
-
-
Kenton Varda authored
Support sending GETs with bodies.
-
Kenton Varda authored
Primarily, we want to support proxies passing through such requests blindly. So, I didn't add any new API for this, just added some hacks so that things "just work" when proxying.
-
Kenton Varda authored
Fix bugs in relative URL parser
-
- 13 Mar, 2018 5 commits
-
-
Harris Hancock authored
-
Harris Hancock authored
The relative URL parser allowed certain hosts which the absolute parser correctly weeded out. This change copies two lines from the absolute parser over to the relative parser.
-
Kenton Varda authored
Explicate List element Kinds in generated code
-
Harris Hancock authored
-
Harris Hancock authored
Various versions of MSVC have various troubles deducing the Kind K of a List<T, K>. This change removes any need for the compiler to deduce the Kind, and just hard-codes it into the generated code. Fixes #642.
-
- 26 Feb, 2018 1 commit
-
-
Kenton Varda authored
Extend HttpServer to inform the caller when a connection ends cleanly on drain().
-
- 25 Feb, 2018 1 commit
-
-
Kenton Varda authored
-
- 23 Feb, 2018 2 commits
-
-
Kenton Varda authored
This allows an application which calls drain() to potentially pass off HTTP connections to a new HttpServer afterwards. Without this, the application has no way to know if the connections are in an indeterminant state. This change also makes it OK for an application to fail to read the whole request body. Previously, if an app returned a response without reading the whole request, an exception would eventually be thrown, but potentially not until the client had initiated a new request on the same connection. The client would then get a spurious 500 error.
-
Kenton Varda authored
-
- 17 Feb, 2018 1 commit
-
-
Kenton Varda authored
Escape CMake config var in configure.ac
-
- 16 Feb, 2018 4 commits
-
-
Harris authored
-
Harris authored
-
Harris Hancock authored
Instantiating kj::downcast<T, T>() causes a compile failure with -Werror=address because the compiler knows the dynamic_cast check in downcast() can never fail.
-
Kenton Varda authored
Redesign server-side WebSocket handling.
-
- 13 Feb, 2018 1 commit
-
-
Kenton Varda authored
Previously HttpService had two virtual methods: request() and openWebSocket(). Since it's legitimate to respond to a WebSocket request with a normal HTTP response, openWebSocket() actually had a default implementation that fell back to request(). In the new design, there is only request(). The HttpService detects a WebSocket request by checking the headers. A convenience method, HttpHeaders::isWebSocket(), is provided for this purpose. The new approach makes life much easier for services composed of many layers. For example, you might write an HttpService implementation which performs some URL or header rewrite and then calls on to another HttpService. Previously, every such wrapper would have to separately handle regular requests and WebSockets, usually with near-identical code. Of course, you could factor out the common code, but in practice this often turned out pretty clunky. Worse, developers would often just omit the openWebSocket() implementation since implementing only request() seems to work fine -- until you need a WebSocket, and everything is broken. With the new approach, you have to go somewhat out of your way to write a wrapper layer that breaks WebSockets. I did not apply the same logic to HttpClient because: 1. It's not as easy: HttpClient's methods return results rather than calling a callback on completion, so unifying the methods would have forced request()'s signature to change. Lots of code would need to be updated, and would likely become uglier, as request() would now have to return a `webSocketOrBody` variant type even when the caller isn't asking for a WebSocket. 2. People don't implement custom HttpClients nearly as often as they implement custom HttpServices.
-
- 11 Feb, 2018 3 commits
-
-
Harris Hancock authored
Previously ${CMAKE_CURRENT_LIST_DIR} was expanded (to an empty string) before CapnProtoConfig.cmake.in was configured, resulting in CapnProtoConfig.cmake setting CAPNP_INCLUDE_DIRECTORY to "/../../include", which is obviously wrong.
-
Kenton Varda authored
-
Kenton Varda authored
This is particularly useful for implementing logic to grab the client's IP address and shove it in X-Real-IP.
-
- 08 Feb, 2018 3 commits
-
-
Kenton Varda authored
Fix new compiler warnings.
-
Kenton Varda authored
Add project() call to root CMakeLists.txt
-
Kenton Varda authored
-