Closed sergey-litvinov-work closed 6 years ago
@joukevandermaas just wanted to double check, you want me to do something more there or you just waiting for something? as you haven't merged these changes :)
@sergey-litvinov-work my apologies, I got distracted by other things and completely forgot.
Thanks!
Hi Jouke,
This is small PR to fix one small issue. It happens for us only when we host it under IIS (Win10\WinServer 2016 and probably all others too).
The issue is that top self link always includes port even if port is standard like this:
or like this
It's still valid url as it can contain port, but it looks a bit weird. Somehow IIS always pushes port in the
Request.Url
and_baseUrl.OriginalUrl
always has it, and when we pass Uri as object for serialization, then Newtonsoft.Json uses.OriginalUrl
and it gives us 80\443 ports for regular http\https hosting.I pushed change to use
_baseUri.AbsoluteUri
in theResourceSerializer
and also updated a couple of unit tests as they were using Uri from JObject but now it has just regular string. I also added unit test forResourceSerializer
to test this specific case. Also i verified that non standard ports still are displayed under IIS\IIS ExpressHere is also screenshot of VisualStudio watch that shows current values during debug
Full response example before fix looks like it: