Comments (6)
Yeah, 100% agree with @nyamsprod - the rtrim
should be removed imho, as http://example.com/sub
and http://example.com/sub/
are two different but valid locations. I think it doesn't break anything if we just remove the rtrim
, does it?
from url.
Totally get it and understand it. I extended it for now and override this part. Will create a PR that fixes that as soon as I have some time. But dunno when. Thanks for your reply @sebastiandedeyne
from url.
Hmm I think I blame Guzzle here but I understand the frustration.
I'd accept a non-breaking PR that keeps the trailing slash if it's initially passed. Not sure if this is gonna be easy though.
from url.
@sebastiandedeyne the question is why is this package removing the trailing slash from the path. it is true that http://example.com
and http://example.com/
may be considered equal but http://example.com/v1/
and http://example.com/v1
can not.
By removing the trailing slash you are directly feeding wrong information to any package that will use URL resolution according to RFC3986 which is what Guzzle is doing.
So the only resolution for this bug is to remove the rtrim
usage in the library. But If I understand it correctly this would mean introducing a BC break.
from url.
the question is why is this package removing the trailing slash from the path
It's been too long. I remember it made some parts of the package easier to have everything consistent, but don't remember where.
I'm willing to review PR that removes rtrim
and fixes whatever needs to be fixed, but at the moment I don't have time to work on this myself, sorry!
from url.
Dear contributor,
because this issue seems to be inactive for quite some time now, I've automatically closed it. If you feel this issue deserves some attention from my human colleagues feel free to reopen it.
from url.
Related Issues (16)
- Does not work with query parameters without values HOT 1
- Ability to get first and last segment? HOT 3
- Ability to configure `VALID_SCHEMES` or disable scheme validation HOT 3
- Full example in the introduction to spatie/url HOT 2
- Url 'javascript:void();' results in fatal error HOT 5
- Easy way to remove query string? HOT 1
- Leading slash in path HOT 1
- Bug: method withQueryParameter cleans all previous parameters HOT 3
- Support application/x-www-form-urlencoded HOT 2
- Spatie menu fails of Url::fromString method fails HOT 1
- Duplicate question mark for query params HOT 1
- Add ability to get unencoded string
- Should add support for psr/http-message 2.0 HOT 1
- Android app link HOT 2
- Default constructor result is unexpected HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from url.