Support default port for known schemas#1478
Conversation
- Update tests which expected urls without port to fail - Add new tests for default ports
| public void PortUtils_TryExtract_DefaultPort_Https_Returns_True() | ||
| { | ||
| // Assign | ||
| var url = "https://0.0.0.0"; |
There was a problem hiding this comment.
Can you check if you can also add a "real" unit test which starts wiremock at https;//0.0.0.0 or https://localhost with that port?
(it could be that that test runs locally correct, and maybe in CI-CD fails, maybe, we have to see)
|
@StefH I tried adding a test as you suggested and it fails I believe because the port is already in use. I guess something to do with running as a hosted service under IIS vs running in a unit test context. It's essentially calling the same code |
|
I guess you test locally in Windows? If you create a simple console-app, and use that setup, does it also fail? |
|
@DavidJohnWilliams And if this keeps failing, then I my assumption is that providing a port is mandatory and does make sense. So in that case, no change in the code is needed, only updating the docs is required. Agree? |
|
Hi, sorry for the delay. I tried creating a console app. It actually fails whether I include a port or not. For background we are hosting our instance of WireMock in IIS under "https://customdomain.local" which is configured with port 443 and a certificate. In the console app, I tried:
However when hosting under IIS both of the first two options work. As I said before, I think if the docs are clear that a port is required, then I am happy with that. I mostly raised this because it was a breaking change for us. We had been running without a port specified, and didn't see anything in the changelog or docs about requiring one. |
References
Submitter checklist
#help-contributingor a project-specific channel like#wiremock-java