Licensed under the Apache License, Version 2.0.
Available at
-https://github.com/aspnet/AspNetCore/blob/master/LICENSE.txt
+https://github.com/dotnet/aspnetcore/blob/master/LICENSE.txt
-License notice for Slicing-by-8
+License notice for Slicing-by-8
-------------------------------
http://sourceforge.net/projects/slicing-by-8/
use or other dealings in these Data Files or Software without prior
written authorization of the copyright holder.
-License notice for Zlib
+License notice for Zlib
-----------------------
https://github.com/madler/zlib
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
License notice for International Organization for Standardization
descriptions are © 1997-2005 Sean Eron Anderson. The code and descriptions are
distributed in the hope that they will be useful, but WITHOUT ANY WARRANTY and
without even the implied warranty of merchantability or fitness for a particular
-purpose.
+purpose.
License notice for Brotli
--------------------------------------
---------------------------
The punycode implementation is based on the sample code in RFC 3492
-
+
Copyright (C) The Internet Society (2003). All Rights Reserved.
This document and translations of it may be copied and furnished to
RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
PARTICULAR PURPOSE.
-License notice for Algorithm from RFC 4122 -
+License notice for Algorithm from RFC 4122 -
A Universally Unique IDentifier (UUID) URN Namespace
----------------------------------------------------
------------------------------
Greg Parker gparker@cs.stanford.edu December 2000
-This code is in the public domain and may be copied or modified without
-permission.
+This code is in the public domain and may be copied or modified without
+permission.
License notice for libunwind based code
----------------------------------------
/******************************************************************************
Copyright (c) 2014 Ryan Juckett
http://www.ryanjuckett.com/
-
+
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
-
+
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
-
+
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
-
+
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
-
+
3. This notice may not be removed or altered from any source
distribution.
******************************************************************************/
4. How common is it in the case of (3) for such invocations to then dereference the result rather than passing it off to something else that accepts a `T?`?
`Object.ToString` is arguably the most extreme case. Answering the above questions:
-1. It is fairly easy in any reasonably-sized code base to find cases, intentional or otherwise, where `ToString` returns `null` in some cases (we've found examples in dotnet/corefx, dotnet/roslyn, NuGet/NuGet.Client, aspnet/AspNetCore, and so on). One of the most prevalent conditions for this are types that just return the value in a string field which may contain its default value of `null`, and in particular for structs where a ctor may not have even had a chance to run and validate an input. Guidance in the docs suggests that `ToString` shouldn't return `null` or `string.Empty`, but even the docs don't follow its own guidance.
+1. It is fairly easy in any reasonably-sized code base to find cases, intentional or otherwise, where `ToString` returns `null` in some cases (we've found examples in dotnet/corefx, dotnet/roslyn, NuGet/NuGet.Client, dotnet/aspnetcore, and so on). One of the most prevalent conditions for this are types that just return the value in a string field which may contain its default value of `null`, and in particular for structs where a ctor may not have even had a chance to run and validate an input. Guidance in the docs suggests that `ToString` shouldn't return `null` or `string.Empty`, but even the docs don't follow its own guidance.
2. Thousands upon thousands of types we don't control override this method today.
3. It's common for helper routines to invoke via the base `object.ToString`, but many `ToString` uses are actually on derived types. This is particularly true when working in a code base that both defines a type and consumes its `ToString`.
4. Based on examination of several large code bases, we believe it to be relatively rare that the result of an `Object.ToString` call (made on the base) to be directly dereferenced. It's much more common to pass it to another method that accepts `string?`, such as `String.Concat`, `String.Format`, `Console.WriteLine`, logging utilities, and so on. And while we advocate that `ToString` results shouldn't be assumed to be in a particular machine-readable format and parsed, it's certainly the case that code bases do, such as using `Substring` on the result, but in such cases, the caller needs to understand the format of what's being rendered, which generally means they're working with a derived type rather than calling through the base `Object.ToString`.
Licensed under the Apache License, Version 2.0.
Available at
-https://github.com/aspnet/AspNetCore/blob/master/LICENSE.txt
+https://github.com/dotnet/aspnetcore/blob/master/LICENSE.txt
License notice for Slicing-by-8
-------------------------------
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
License notice for International Organization for Standardization
descriptions are © 1997-2005 Sean Eron Anderson. The code and descriptions are
distributed in the hope that they will be useful, but WITHOUT ANY WARRANTY and
without even the implied warranty of merchantability or fitness for a particular
-purpose.
+purpose.
License notice for Brotli
--------------------------------------
---------------------------
The punycode implementation is based on the sample code in RFC 3492
-
+
Copyright (C) The Internet Society (2003). All Rights Reserved.
This document and translations of it may be copied and furnished to
------------------------------
Greg Parker gparker@cs.stanford.edu December 2000
-This code is in the public domain and may be copied or modified without
-permission.
+This code is in the public domain and may be copied or modified without
+permission.
License notice for libunwind based code
----------------------------------------
/******************************************************************************
Copyright (c) 2014 Ryan Juckett
http://www.ryanjuckett.com/
-
+
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
-
+
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
-
+
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
-
+
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
-
+
3. This notice may not be removed or altered from any source
distribution.
******************************************************************************/
All rights reserved.
-Redistribution and use in source and binary forms, with or without
+Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
-1) Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
+1) Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
2) Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
+ and/or other materials provided with the distribution.
3) Neither the name of the ORGANIZATION nor the names of its contributors
may be used to endorse or promote products derived from this software
- without specific prior written permission.
+ without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-The code in this directory is shared between dotnet/runtime and dotnet/AspNetCore. This contains HTTP/2 and HTTP/3 protocol infrastructure such as an HPACK implementation. Any changes to this dir need to be checked into both repositories.
+The code in this directory is shared between dotnet/runtime and dotnet/aspnetcore. This contains HTTP/2 and HTTP/3 protocol infrastructure such as an HPACK implementation. Any changes to this dir need to be checked into both repositories.
dotnet/runtime code paths:
- runtime\src\libraries\Common\src\System\Net\Http\aspnetcore
- runtime\src\libraries\Common\tests\Tests\System\Net\aspnetcore
-dotnet/AspNetCore code paths:
-- AspNetCore\src\Shared\runtime
-- AspNetCore\src\Shared\test\Shared.Tests\runtime
+dotnet/aspnetcore code paths:
+- aspnetcore\src\Shared\runtime
+- aspnetcore\src\Shared\test\Shared.Tests\runtime
## Copying code
-- To copy code from dotnet/runtime to dotnet/AspNetCore, set ASPNETCORE_REPO to the AspNetCore repo root and then run CopyToAspNetCore.cmd.
-- To copy code from dotnet/AspNetCore to dotnet/runtime, set RUNTIME_REPO to the runtime repo root and then run CopyToRuntime.cmd.
+- To copy code from dotnet/runtime to dotnet/aspnetcore, set ASPNETCORE_REPO to the aspnetcore repo root and then run CopyToAspNetCore.cmd.
+- To copy code from dotnet/aspnetcore to dotnet/runtime, set RUNTIME_REPO to the runtime repo root and then run CopyToRuntime.cmd.
## Building dotnet/runtime code:
- https://github.com/dotnet/runtime/tree/master/docs/workflow
- `PS D:\github\runtime\src\libraries\Common\tests> dotnet build /t:test`
- `PS D:\github\runtime\src\libraries\System.Net.Http\tests\UnitTests> dotnet build /t:test`
-## Building dotnet/AspNetCore code:
-- https://github.com/dotnet/AspNetCore/blob/main/docs/BuildFromSource.md
-- Run restore in the root once: `PS D:\github\AspNetCore> .\restore.cmd`
-- Activate to use the repo local runtime: `PS D:\github\AspNetCore> . .\activate.ps1`
+## Building dotnet/aspnetcore code:
+- https://github.com/dotnet/aspnetcore/blob/main/docs/BuildFromSource.md
+- Run restore in the root once: `PS D:\github\aspnetcore> .\restore.cmd`
+- Activate to use the repo local runtime: `PS D:\github\aspnetcore> . .\activate.ps1`
- Build the individual projects:
-- `(AspNetCore) PS D:\github\AspNetCore\src\Shared\test\Shared.Tests> dotnet build`
-- `(AspNetCore) PS D:\github\AspNetCore\src\servers\Kestrel\core\src> dotnet build`
+- `(aspnetcore) PS D:\github\aspnetcore\src\Shared\test\Shared.Tests> dotnet build`
+- `(aspnetcore) PS D:\github\aspnetcore\src\servers\Kestrel\core\src> dotnet build`
-### Running dotnet/AspNetCore tests:
-- `(AspNetCore) PS D:\github\AspNetCore\src\Shared\test\Shared.Tests> dotnet test`
-- `(AspNetCore) PS D:\github\AspNetCore\src\servers\Kestrel\core\test> dotnet test`
+### Running dotnet/aspnetcore tests:
+- `(aspnetcore) PS D:\github\aspnetcore\src\Shared\test\Shared.Tests> dotnet test`
+- `(aspnetcore) PS D:\github\aspnetcore\src\servers\Kestrel\core\test> dotnet test`
For additional details see:
- runtime/src/libraries/Common/src/System/Net/Http/aspnetcore/ReadMe.SharedCode.md
-- AspNetCore/src/Shared/runtime/ReadMe.SharedCode.md
+- aspnetcore/src/Shared/runtime/ReadMe.SharedCode.md
string CreateHeaderValue() => HttpUtility.UrlEncode(GetRandomString(1, 30, alphaNumericOnly: false));
string[] values = Enumerable.Range(0, _random.Next(1, 6)).Select(_ => CreateHeaderValue()).ToArray();
totalSize += name.Length + values.Select(v => v.Length + 2).Sum();
-
- if (totalSize > MaxRequestHeaderTotalSize)
+
+ if (totalSize > MaxRequestHeaderTotalSize)
{
break;
}
using var req = new HttpRequestMessage(HttpMethod.Get, "/get");
int expectedLength = ctx.SetExpectedResponseContentLengthHeader(req.Headers);
using HttpResponseMessage m = await ctx.SendAsync(req);
-
+
ValidateStatusCode(m);
ValidateServerContent(await m.Content.ReadAsStringAsync(), expectedLength);
}),
{
using var req = new HttpRequestMessage(HttpMethod.Get, "/abort");
ctx.SetExpectedResponseContentLengthHeader(req.Headers, minLength: 2);
-
+
await ctx.SendAsync(req);
throw new Exception("Completed unexpectedly");
case "Http2ProtocolException":
case "Http2ConnectionException":
case "Http2StreamException":
- if ((e.InnerException?.Message?.Contains("INTERNAL_ERROR") ?? false) || // UseKestrel (https://github.com/aspnet/AspNetCore/issues/12256)
+ if ((e.InnerException?.Message?.Contains("INTERNAL_ERROR") ?? false) || // UseKestrel (https://github.com/dotnet/aspnetcore/issues/12256)
(e.InnerException?.Message?.Contains("CANCEL") ?? false)) // UseHttpSys
{
return;
{
if (actualContent != expectedContent)
{
- int divergentIndex =
+ int divergentIndex =
Enumerable
.Zip(actualContent, expectedContent)
.Select((x,i) => (x.First, x.Second, i))
// Use Kestrel, and configure it for HTTPS with a self-signed test certificate.
host = host.UseKestrel(ko =>
{
- // conservative estimation based on https://github.com/aspnet/AspNetCore/blob/caa910ceeba5f2b2c02c47a23ead0ca31caea6f0/src/Servers/Kestrel/Core/src/Internal/Http2/Http2Stream.cs#L204
+ // conservative estimation based on https://github.com/dotnet/aspnetcore/blob/caa910ceeba5f2b2c02c47a23ead0ca31caea6f0/src/Servers/Kestrel/Core/src/Internal/Http2/Http2Stream.cs#L204
ko.Limits.MaxRequestLineSize = Math.Max(ko.Limits.MaxRequestLineSize, configuration.MaxRequestUriSize + 100);
ko.Limits.MaxRequestHeaderCount = Math.Max(ko.Limits.MaxRequestHeaderCount, configuration.MaxRequestHeaderCount);
ko.Limits.MaxRequestHeadersTotalSize = Math.Max(ko.Limits.MaxRequestHeadersTotalSize, configuration.MaxRequestHeaderTotalSize);
}
else
{
- listenOptions.Protocols =
+ listenOptions.Protocols =
configuration.HttpVersion == new Version(2,0) ?
HttpProtocols.Http2 :
HttpProtocols.Http1 ;
LoggerConfiguration loggerConfiguration = new LoggerConfiguration();
if (configuration.Trace)
{
- // Clear existing logs first.
+ // Clear existing logs first.
foreach (var filename in Directory.GetFiles(".", "server*.log"))
{
try
// Post echos back the requested content, first buffering it all server-side, then sending it all back.
var s = new MemoryStream();
await context.Request.Body.CopyToAsync(s);
-
+
ulong checksum = CRC.CalculateCRC(s.ToArray());
AppendChecksumHeader(context.Response.Headers, checksum);
{
var uri = new Uri(serverUri);
return (uri.Scheme, uri.Host, uri.Port);
- }
+ }
catch (UriFormatException)
{
// Simple uri parser: used to parse values valid in Kestrel
int GetExpectedContentLength()
{
- if (ctx.Request.Headers.TryGetValue(ExpectedResponseContentLength, out StringValues values) &&
+ if (ctx.Request.Headers.TryGetValue(ExpectedResponseContentLength, out StringValues values) &&
values.Count == 1 &&
int.TryParse(values[0], out int result))
{