Coder Social home page Coder Social logo

Trailing Slash is removed about url HOT 6 CLOSED

spatie avatar spatie commented on May 18, 2024
Trailing Slash is removed

from url.

Comments (6)

stefanbauer avatar stefanbauer commented on May 18, 2024 1

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.

stefanbauer avatar stefanbauer commented on May 18, 2024 1

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.

sebastiandedeyne avatar sebastiandedeyne commented on May 18, 2024

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.

nyamsprod avatar nyamsprod commented on May 18, 2024

@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.

sebastiandedeyne avatar sebastiandedeyne commented on May 18, 2024

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.

spatie-bot avatar spatie-bot commented on May 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.