Closed douglaslinsmeyer closed 7 years ago
Are you able to create some tests for this?
Yeah, and it looks like I have to address something in the "withs" suite as well, I can't do that immediately but this evening I'll be able to.
This is a use case I have overlooked as I very rarely have paths like <host>/file.php/some/path
in my own projects, but thanks a bunch for putting it out there. If you manage to add some test cases I'd love to pull it into the project.
@christeredvartsen Have you already been notified that there are several tests that fail intermittently?
The tests fail because of absolute paths no longer work as expected.
If the base_uri
includes a sub directory, for instance http://host/dir
, and one is about to request /path
, then the resulting path should be http://host/path
and not http://host/dir/path
. Have a look at the table in this section for examples:
http://docs.guzzlephp.org/en/latest/quickstart.html#making-a-request
In your specific use case, where the base_uri
includes a script (http://host/script.php
) there is actually no way to use an absolute path and have that appended to script.php
using Guzzle.
@douglaslinsmeyer Do you have any feedback regarding my last comment? Please also check out my comment in the issue.
This goes against the usage that Guzzle has implemented (RFC 3986), so will not merge.
Addresses #20
Adds logic to handle base paths in the base_uri extension configuration setting.
Previously when setting a path to the base_uri it was stripped out when later specifying a request path. In ApiContext::whenIRequestPath calling Request::setRequestPath tells Guzzle to drop the previously set path. This adds logic to check for a preset path then appends the new path to that.