Resolve files will not download when using curl 7.62.0 (http2 issue) (#225)

* Force connections to use HTTP 1.1 as Curl 7.62.0 defaults to using http2 if h2 support is built in which causes issues
This commit is contained in:
abraunegg 2018-11-11 06:38:41 +11:00 committed by GitHub
parent eb2cbfd0a8
commit 11e477f045
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,4 +1,5 @@
import std.net.curl: CurlException, HTTP;
import std.net.curl;
import etc.c.curl: CurlOption;
import std.datetime, std.exception, std.file, std.json, std.path;
import std.stdio, std.string, std.uni, std.uri;
import core.stdc.stdlib;
@ -58,6 +59,11 @@ final class OneDriveApi
http = HTTP();
http.dnsTimeout = (dur!"seconds"(5));
http.dataTimeout = (dur!"seconds"(3600));
// Specify which HTTP version to use
// Curl 7.62.0 defaults to http2, we need to use http 1.1
http.handle.set(CurlOption.http_version,2);
if (debugHttp) {
http.verbose = true;
.debugResponse = true;