-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve discovery of server root when url is for "services" endpoint. #582
Improve discovery of server root when url is for "services" endpoint. #582
Conversation
Previously it required a slash at the end. Now it works with pound, question mark and end of string.
Codecov Report
@@ Coverage Diff @@
## master #582 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 93 93
Lines 1366 1366
Branches 245 245
=====================================
Hits 1366 1366
Continue to review full report at Codecov.
|
Thanks @kenlyon! I would have expected the fix for your issue to just make the trailing Maybe there's a use case that I can't imagine, but I don't think we need to support the other delimiters. My personal preference would be to wait until someone asks us to support |
My main concern was that we don't have a false positive on something like: Admittedly, I think any url fragment in that position that starts with "services" but then has following characters would probably not be referring to a resource that exists. Still, if all we did was make the trailing slash optional, we make the match less reliable in that way. If we didn't care about |
As I think about the context a little more, the I think that I know from my own case that "end of string" was what followed my "services". Anyway, all that to say that it could be safe to simplify the regular expression a bit for the expected usage, but edge cases or future use might reveal the limitations of it, so I tend to favour the more comprehensive implementation to avoid surprises down the road. Totally up to you, though. :) Let me know what you'd like. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You've convinced me!
Previously it required a slash at the end. Now it works with pound,
question mark and end of string.