mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 06:00:46 +00:00
Omit RFC for Steam compat
This commit is contained in:
@@ -605,27 +605,13 @@ namespace ArchiSteamFarm {
|
|||||||
redirectUri = new Uri(requestUri, redirectUri);
|
redirectUri = new Uri(requestUri, redirectUri);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
response.Dispose();
|
||||||
|
|
||||||
// Per https://tools.ietf.org/html/rfc7231#section-7.1.2, a redirect location without a fragment should inherit the fragment from the original URI
|
// Per https://tools.ietf.org/html/rfc7231#section-7.1.2, a redirect location without a fragment should inherit the fragment from the original URI
|
||||||
if (!string.IsNullOrEmpty(requestUri.Fragment) && string.IsNullOrEmpty(redirectUri.Fragment)) {
|
if (!string.IsNullOrEmpty(requestUri.Fragment) && string.IsNullOrEmpty(redirectUri.Fragment)) {
|
||||||
redirectUri = new UriBuilder(redirectUri) { Fragment = requestUri.Fragment }.Uri;
|
redirectUri = new UriBuilder(redirectUri) { Fragment = requestUri.Fragment }.Uri;
|
||||||
}
|
}
|
||||||
|
|
||||||
// According to the RFC, POST requests in certain types of redirection must be converted into GET
|
|
||||||
if (httpMethod == HttpMethod.Post) {
|
|
||||||
switch (response.StatusCode) {
|
|
||||||
case HttpStatusCode.Found:
|
|
||||||
case HttpStatusCode.Moved:
|
|
||||||
case HttpStatusCode.MultipleChoices:
|
|
||||||
case HttpStatusCode.SeeOther:
|
|
||||||
httpMethod = HttpMethod.Get;
|
|
||||||
data = null;
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
response.Dispose();
|
|
||||||
|
|
||||||
return await InternalRequest(redirectUri, httpMethod, data, referer, httpCompletionOption, --maxRedirections).ConfigureAwait(false);
|
return await InternalRequest(redirectUri, httpMethod, data, referer, httpCompletionOption, --maxRedirections).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user