Skip to content

Commit 39f8ada

Browse files
committed
Cleanup whitespace and pass inner exception
1 parent 4cf663a commit 39f8ada

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/Servers/Kestrel/Core/src/Internal/Infrastructure/HttpUtilities.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,9 @@ public static string GetRequestHeaderString(this ReadOnlySpan<byte> span, string
160160
{
161161
return encoding.GetString(span);
162162
}
163-
catch (DecoderFallbackException)
163+
catch (DecoderFallbackException ex)
164164
{
165-
throw new InvalidOperationException();
165+
throw new InvalidOperationException(ex.Message, ex);
166166
}
167167
}
168168

@@ -555,11 +555,11 @@ private static bool IsHex(char ch)
555555
}
556556

557557
// Allow for de-virtualization (see https://github.com/dotnet/coreclr/pull/9230)
558-
private sealed class UTF8EncodingSealed : UTF8Encoding
559-
{
560-
public UTF8EncodingSealed() : base(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true) { }
558+
private sealed class UTF8EncodingSealed : UTF8Encoding
559+
{
560+
public UTF8EncodingSealed() : base(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true) { }
561561

562-
public override byte[] GetPreamble() => Array.Empty<byte>();
562+
public override byte[] GetPreamble() => Array.Empty<byte>();
563563
}
564564
}
565565
}

src/Servers/Kestrel/Core/src/KestrelServerOptions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public Func<string, Encoding> RequestHeaderEncodingSelector
8888
{
8989
get => _requestHeaderEncodingSelector;
9090
set => _requestHeaderEncodingSelector = value ?? throw new ArgumentNullException(nameof(value));
91-
}
91+
}
9292

9393
/// <summary>
9494
/// Enables the Listen options callback to resolve and use services registered by the application during startup.
@@ -153,7 +153,7 @@ internal Func<string, Encoding> GetRequestHeaderEncodingSelector()
153153

154154
internal void ApplyEndpointDefaults(ListenOptions listenOptions)
155155
{
156-
listenOptions.KestrelServerOptions = this;
156+
listenOptions.KestrelServerOptions = this;
157157
ConfigurationLoader?.ApplyConfigurationDefaults(listenOptions);
158158
EndpointDefaults(listenOptions);
159159
}

0 commit comments

Comments
 (0)