Describe the bug
If you use the Urls setting and don't supply a port, when starting under ASP.Net Core you receive a timeout error.
The actual error is a NRE from this line:
|
if (originalScheme!.StartsWith("grpc", StringComparison.OrdinalIgnoreCase)) |
PortUtils.TryExtract has null annotations to say that the scheme out parameter will be null if TryExtract returns false, but there is a null-forgiving operator on the next line so you get a NRE.
Expected behavior:
Either no port is allowed and the code above should not run if TryExtract returns false; or the docs should be updated to explain that port is required on entries in Urls.
Test to reproduce
- 1 - Add a url to
Urls without a port
- 2 - Start the server
Other related info
Side note: The exception thrown from Start is a timeout rather than the actual exception that occurred which made debugging the issue more difficult. It would be good to solve that as well.
BTW, I am happy to create a PR for this, but I'm raising the issue first for discussion.
Describe the bug
If you use the
Urlssetting and don't supply a port, when starting under ASP.Net Core you receive a timeout error.The actual error is a NRE from this line:
WireMock.Net/src/WireMock.Net.Minimal/Owin/AspNetCoreSelfHost.cs
Line 152 in cbc28c2
PortUtils.TryExtracthas null annotations to say that theschemeout parameter will be null ifTryExtractreturnsfalse, but there is a null-forgiving operator on the next line so you get a NRE.Expected behavior:
Either no port is allowed and the code above should not run if
TryExtractreturnsfalse; or the docs should be updated to explain that port is required on entries inUrls.Test to reproduce
Urlswithout a portOther related info
Side note: The exception thrown from
Startis a timeout rather than the actual exception that occurred which made debugging the issue more difficult. It would be good to solve that as well.BTW, I am happy to create a PR for this, but I'm raising the issue first for discussion.