upgraded dependencies
Build and Test Module / build-and-test (push) Successful in 11s
Details
Build and Test Module / build-and-test (push) Successful in 11s
Details
This commit is contained in:
parent
4709f8b00c
commit
c2cd2cfc5c
4
dub.json
4
dub.json
|
@ -4,9 +4,9 @@
|
||||||
],
|
],
|
||||||
"copyright": "Copyright © 2024, Andrew Lalis",
|
"copyright": "Copyright © 2024, Andrew Lalis",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"handy-http-primitives": "~>1.2",
|
"handy-http-primitives": "~>1.5",
|
||||||
"photon": "~>0.10",
|
"photon": "~>0.10",
|
||||||
"streams": "~>3.5"
|
"streams": "~>3.6"
|
||||||
},
|
},
|
||||||
"description": "Implementations of HTTP transport protocols.",
|
"description": "Implementations of HTTP transport protocols.",
|
||||||
"license": "CC0",
|
"license": "CC0",
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
{
|
{
|
||||||
"fileVersion": 1,
|
"fileVersion": 1,
|
||||||
"versions": {
|
"versions": {
|
||||||
"handy-http-primitives": "1.2.0",
|
"handy-http-primitives": "1.5.0",
|
||||||
"photon": "0.10.2",
|
"photon": "0.10.2",
|
||||||
"sharded-map": "2.7.0",
|
"sharded-map": "2.7.0",
|
||||||
"streams": "3.5.0"
|
"streams": "3.6.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,7 +97,10 @@ void handleClient(Socket clientSocket, HttpRequestHandler requestHandler) {
|
||||||
stderr.writeln("Throwable error while handling request: " ~ t.msg);
|
stderr.writeln("Throwable error while handling request: " ~ t.msg);
|
||||||
throw t;
|
throw t;
|
||||||
}
|
}
|
||||||
inputStream.closeStream();
|
|
||||||
|
if (response.status != HttpStatus.SWITCHING_PROTOCOLS) {
|
||||||
|
inputStream.closeStream();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test case where we use a local socket pair to test the full handleClient
|
// Test case where we use a local socket pair to test the full handleClient
|
||||||
|
@ -194,6 +197,8 @@ HttpRequestParseResult readHttpRequest(S)(S inputStream, in ClientAddress addr)
|
||||||
auto headersResult = parseHeaders(inputStream);
|
auto headersResult = parseHeaders(inputStream);
|
||||||
if (headersResult.hasError) return HttpRequestParseResult(headersResult.error);
|
if (headersResult.hasError) return HttpRequestParseResult(headersResult.error);
|
||||||
|
|
||||||
|
auto queryParams = parseQueryParameters(urlStr.value);
|
||||||
|
|
||||||
import std.uri : decode; // TODO: Remove dependency on phobos for this?
|
import std.uri : decode; // TODO: Remove dependency on phobos for this?
|
||||||
|
|
||||||
return HttpRequestParseResult(ServerHttpRequest(
|
return HttpRequestParseResult(ServerHttpRequest(
|
||||||
|
@ -202,6 +207,7 @@ HttpRequestParseResult readHttpRequest(S)(S inputStream, in ClientAddress addr)
|
||||||
methodStr.value,
|
methodStr.value,
|
||||||
decode(urlStr.value),
|
decode(urlStr.value),
|
||||||
headersResult.headers,
|
headersResult.headers,
|
||||||
|
queryParams,
|
||||||
inputStreamObjectFor(inputStream)
|
inputStreamObjectFor(inputStream)
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue