Skip to content
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

Consistently resolve base URL according to HTTP specs #379

Merged
merged 2 commits into from
Jul 26, 2020

Conversation

clue
Copy link
Member

@clue clue commented Jul 25, 2020

This changeset improves the base URL logic to consistently resolve base URL according to HTTP specs (https://tools.ietf.org/html/rfc3986#section-5.2).

// new: will request http://api.example.com/v2/users
$browser = $browser->withBase('http://api.example.com/v3/');
$browser->get('../v2/users')->then(…);

I consider this to be a feature addition and not a BC break because the previous behavior was both unclear and not well-defined. This now follows common URL resolving logic supporting relative references such as ../,./ and others.

@clue clue added this to the v1.1.0 milestone Jul 25, 2020
@clue clue requested review from jsor and WyriHaximus July 26, 2020 12:58
@jsor jsor merged commit 7873a87 into reactphp:master Jul 26, 2020
@clue clue deleted the resolve-base-url branch July 27, 2020 08:34
clue added a commit to clue-labs/reactphp-docker that referenced this pull request Jul 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants