diff --git a/ArchiSteamFarm/Localization/Strings.Designer.cs b/ArchiSteamFarm/Localization/Strings.Designer.cs index 25b1ffb79..baf477242 100644 --- a/ArchiSteamFarm/Localization/Strings.Designer.cs +++ b/ArchiSteamFarm/Localization/Strings.Designer.cs @@ -1179,15 +1179,6 @@ namespace ArchiSteamFarm.Localization { } } - /// - /// Wyszukuje zlokalizowany ciąg podobny do ciągu Status code: {0}. - /// - internal static string StatusCode { - get { - return ResourceManager.GetString("StatusCode", resourceCulture); - } - } - /// /// Wyszukuje zlokalizowany ciąg podobny do ciągu Still idling: {0} ({1}). /// diff --git a/ArchiSteamFarm/Localization/Strings.resx b/ArchiSteamFarm/Localization/Strings.resx index 84c6208ed..905b4eb75 100644 --- a/ArchiSteamFarm/Localization/Strings.resx +++ b/ArchiSteamFarm/Localization/Strings.resx @@ -225,10 +225,6 @@ StackTrace: Starting... - - Status code: {0} - {0} will be replaced by status code number/name - Success! diff --git a/ArchiSteamFarm/WebBrowser.cs b/ArchiSteamFarm/WebBrowser.cs index f174efcbd..d616659b5 100644 --- a/ArchiSteamFarm/WebBrowser.cs +++ b/ArchiSteamFarm/WebBrowser.cs @@ -366,13 +366,25 @@ namespace ArchiSteamFarm { } if (response == null) { + if (Debugging.IsUserDebugging) { + ArchiLogger.LogGenericDebug("null <- " + httpMethod + " " + requestUri); + } + return null; } + if (Debugging.IsUserDebugging) { + ArchiLogger.LogGenericDebug(response.StatusCode + " <- " + httpMethod + " " + requestUri); + } + if (response.IsSuccessStatusCode) { return response; } + if (Debugging.IsUserDebugging) { + ArchiLogger.LogGenericDebug(string.Format(Strings.Content, await response.Content.ReadAsStringAsync().ConfigureAwait(false))); + } + // WARNING: We still have undisposed response by now, make sure to dispose it ASAP if we're not returning it! if ((response.StatusCode >= HttpStatusCode.Ambiguous) && (response.StatusCode < HttpStatusCode.BadRequest) && (maxRedirections > 0)) { Uri redirectUri = response.Headers.Location; @@ -398,15 +410,8 @@ namespace ArchiSteamFarm { return await InternalRequest(redirectUri, httpMethod, data, referer, httpCompletionOption, --maxRedirections).ConfigureAwait(false); } - using (response) { - if (Debugging.IsUserDebugging) { - ArchiLogger.LogGenericDebug(string.Format(Strings.ErrorFailingRequest, requestUri)); - ArchiLogger.LogGenericDebug(string.Format(Strings.StatusCode, response.StatusCode)); - ArchiLogger.LogGenericDebug(string.Format(Strings.Content, await response.Content.ReadAsStringAsync().ConfigureAwait(false))); - } - - return null; - } + response.Dispose(); + return null; } private async Task UrlGetToString(string request, string referer = null, byte maxTries = MaxTries) {