Skip to content
This repository was archived by the owner on Jan 13, 2022. It is now read-only.

Missing Forwardslash #448

Merged
merged 3 commits into from
Jun 9, 2015
Merged

Missing Forwardslash #448

merged 3 commits into from
Jun 9, 2015

Conversation

paul-court
Copy link

Fixed missing forward slash between version number and the rest of the URL.

Fixed missing forward slash between version number and the rest of the URL.
@facebook-github-bot
Copy link

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at [email protected]. Thanks!

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@gfosco
Copy link
Contributor

gfosco commented Jun 2, 2015

Paths are provided with the root /. You make a request to /photos not just photos. This is at least why it was not in there. I'm open to reviewing this if you add a function which handles this and allows leaving off the root / in request paths.

@paul-court
Copy link
Author

Ahh. My bad!

Added a check for a leading / and normalize the path accordingly.

@@ -225,7 +225,8 @@ protected function getRequestURL()
} else {
$baseUrl = static::BASE_GRAPH_URL;
}
return $baseUrl . '/' . $this->version . $this->path;
$normalizedPath = ($this->path[0] == '/') ? $this->path : '/' . $this->path;
Copy link
Contributor

Choose a reason for hiding this comment

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

return $baseUrl . '/' . $this->version . '/' . ltrim($this->path, '/');

@paul-court
Copy link
Author

Thanks yguedidi - Much neater! :-)

@yguedidi
Copy link
Contributor

yguedidi commented Jun 3, 2015

You're welcome :)

gfosco added a commit that referenced this pull request Jun 9, 2015
@gfosco gfosco merged commit 1027056 into facebookarchive:4.0-dev Jun 9, 2015
@paul-court paul-court deleted the patch-1 branch October 18, 2016 10:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants