Added some documentation to readme, and url decoding

This commit is contained in:
Andrew Lalis 2025-01-13 18:10:43 -05:00
parent f20c027e1c
commit 027ad4c1e6
3 changed files with 11 additions and 2 deletions

View File

@ -1,6 +1,12 @@
# http-transport
Implementations of HTTP transport protocols, compatible with other Handy-Http components.
This library provides implementations of various versions of HTTP transport,
acting as a "glue" for connecting clients and servers. Practically speaking,
the handy-http-transport library provides HTTP server implementations you can
use interchangeably with other handy-http libraries.
For now, see the section on HTTP/1.1, as that's the only HTTP version
implemented so far.
## HTTP/1.1

View File

@ -159,11 +159,13 @@ HttpRequestParseResult readHttpRequest(S)(S inputStream, in ClientAddress addr)
auto headersResult = parseHeaders(inputStream);
if (headersResult.hasError) return HttpRequestParseResult(headersResult.error);
import std.uri : decode; // TODO: Remove dependency on phobos for this?
return HttpRequestParseResult(ServerHttpRequest(
httpVersion,
addr,
methodStr.value,
urlStr.value,
decode(urlStr.value),
headersResult.headers,
inputStreamObjectFor(inputStream)
));

View File

@ -1,2 +1,3 @@
module handy_http_transport.http2;
// Not yet implemented.