Skip to content
This repository was archived by the owner on Dec 18, 2018. It is now read-only.

Commit eb74a19

Browse files
committed
Added "451 Unavailable For Legal Reasons" to ReasonPhrases
From RFC7725 - https://tools.ietf.org/html/rfc7725
1 parent f5b483b commit eb74a19

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Microsoft.AspNetCore.Server.Kestrel/Internal/Http/ReasonPhrases.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ public static class ReasonPhrases
5151
private static readonly byte[] _bytesStatus423 = Encoding.ASCII.GetBytes("423 Locked");
5252
private static readonly byte[] _bytesStatus424 = Encoding.ASCII.GetBytes("424 Failed Dependency");
5353
private static readonly byte[] _bytesStatus426 = Encoding.ASCII.GetBytes("426 Upgrade Required");
54+
private static readonly byte[] _bytesStatus451 = Encoding.ASCII.GetBytes("451 Unavailable For Legal Reasons");
5455
private static readonly byte[] _bytesStatus500 = Encoding.ASCII.GetBytes("500 Internal Server Error");
5556
private static readonly byte[] _bytesStatus501 = Encoding.ASCII.GetBytes("501 Not Implemented");
5657
private static readonly byte[] _bytesStatus502 = Encoding.ASCII.GetBytes("502 Bad Gateway");
@@ -153,6 +154,8 @@ public static byte[] ToStatusBytes(int statusCode, string reasonPhrase = null)
153154
return _bytesStatus424;
154155
case 426:
155156
return _bytesStatus426;
157+
case 451:
158+
return _bytesStatus451;
156159
case 500:
157160
return _bytesStatus500;
158161
case 501:
@@ -178,4 +181,4 @@ public static byte[] ToStatusBytes(int statusCode, string reasonPhrase = null)
178181
return Encoding.ASCII.GetBytes(statusCode.ToString(CultureInfo.InvariantCulture) + " " + reasonPhrase);
179182
}
180183
}
181-
}
184+
}

0 commit comments

Comments
 (0)