joukevandermaas / saule

JSON API library for ASP.Net Web API 2.
https://joukevandermaas.github.io/saule
MIT License
76 stars 37 forks source link

Fix self generation for custom route with text IDs #233

Closed DtaggartMB closed 4 years ago

DtaggartMB commented 4 years ago

Found issue due to the change made here

https://github.com/joukevandermaas/saule/pull/231

Due to using the EndsWith method, I missed the case where a user could be using a text based ID with different casing. While developing a new endpoint I saw that the ID was appended twice on the end of the URL.

Added Unit test to catch this in the future.

Solution

Added the StringComparison.InvariantCultureIgnoreCase argument to the endswith logic.

joukevandermaas commented 4 years ago

@DtaggartMB Do you think you can rebase this branch on master? There are a lot of commits now even though the diff is fairly small. I think this is not what you intended?

DtaggartMB commented 4 years ago

Yeah I can