Compare commits

..

No commits in common. "905e3f93f839f186d70737afc64c9e254b864eea" and "4709f8b00cc9fc3908c29a9b2790abebbf8a7ad9" have entirely different histories.

3 changed files with 5 additions and 11 deletions

View File

@ -4,9 +4,9 @@
],
"copyright": "Copyright © 2024, Andrew Lalis",
"dependencies": {
"handy-http-primitives": "~>1.6",
"handy-http-primitives": "~>1.2",
"photon": "~>0.10",
"streams": "~>3.6"
"streams": "~>3.5"
},
"description": "Implementations of HTTP transport protocols.",
"license": "CC0",

View File

@ -1,9 +1,9 @@
{
"fileVersion": 1,
"versions": {
"handy-http-primitives": "1.6.0",
"handy-http-primitives": "1.2.0",
"photon": "0.10.2",
"sharded-map": "2.7.0",
"streams": "3.6.0"
"streams": "3.5.0"
}
}

View File

@ -97,10 +97,7 @@ void handleClient(Socket clientSocket, HttpRequestHandler requestHandler) {
stderr.writeln("Throwable error while handling request: " ~ t.msg);
throw t;
}
if (response.status != HttpStatus.SWITCHING_PROTOCOLS) {
inputStream.closeStream();
}
inputStream.closeStream();
}
// Test case where we use a local socket pair to test the full handleClient
@ -197,8 +194,6 @@ HttpRequestParseResult readHttpRequest(S)(S inputStream, in ClientAddress addr)
auto headersResult = parseHeaders(inputStream);
if (headersResult.hasError) return HttpRequestParseResult(headersResult.error);
auto queryParams = parseQueryParameters(urlStr.value);
import std.uri : decode; // TODO: Remove dependency on phobos for this?
return HttpRequestParseResult(ServerHttpRequest(
@ -207,7 +202,6 @@ HttpRequestParseResult readHttpRequest(S)(S inputStream, in ClientAddress addr)
methodStr.value,
decode(urlStr.value),
headersResult.headers,
queryParams,
inputStreamObjectFor(inputStream)
));
}