Skip to content
This repository has been archived by the owner on May 12, 2018. It is now read-only.

More URI resolution fixes #55

Merged
merged 1 commit into from
Oct 27, 2016
Merged

More URI resolution fixes #55

merged 1 commit into from
Oct 27, 2016

Conversation

matt-allan
Copy link
Collaborator

@matt-allan matt-allan commented Oct 27, 2016

  • properly replace the last component of a path
  • Remove lots of code
  • Add a todo for file URIs

@matt-allan
Copy link
Collaborator Author

I opened sabre-io/uri#10 to resolve the file:// URI issue.

@@ -205,17 +205,28 @@ function resolve_uri($id, $parentScope)
$parts = Uri\parse($id);

if (!empty($parts['path'])) {
// If the path ends in a slash, it shouldn't be replaced but instead appended to.
// If the original path ends in a slash, it shouldn't be replaced but instead appended to.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you consider Sabre\Uri\resolve for this? Curious if it's not good enough, or if there's something I can improve

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought there was a reason I couldn't use it, but all of the tests seem to pass.

IIRC the issue was just that the spec expected me to keep an extraneous '#' if it existed on the base URI, even if there wasn't a fragment. It doesn't actually affect schema resolution though.

Anyway, that saves me from maintaining quite a bit of error prone code, so thanks 👍

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's awesome!

@matt-allan matt-allan merged commit a02915e into thephpleague:master Oct 27, 2016
@matt-allan matt-allan deleted the improve-uri-resolution branch October 27, 2016 04:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants