Giter Site home page Giter Site logo

Potentially misparsed URL about autolink-java HOT 3 CLOSED

robinst avatar robinst commented on August 16, 2024
Potentially misparsed URL

from autolink-java.

Comments (3)

robinst avatar robinst commented on August 16, 2024

Hey, thanks for the report. So, RFC 3986 allows "." in the scheme:

scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )

Having said that, the only use of "." I can find in IANA's registry is "z39.50". So maybe we could restrict it to only allow a single "." instead of multiple dots.

That would mean something like foo.http://i.imgur.com would still be recognized as a URL, but not your example.

What do you think?

from autolink-java.

silvanheller avatar silvanheller commented on August 16, 2024

Thanks for the reply! I see the problem with RFC 3986. In that case, I think in that case it's maybe better to leave this as documented behavior which programmers have to catch since I feel like Protocol adherence > convenience.
Especially since your proposed solution does not fully fix the problem. What would solve it is an extractor which only looks for HTTP[s] schemes and strips everything else from the scheme, but i feel like that's outside the scope of this library.
Funnily enough, twitter doesn't have that problem on their Conformance List

from autolink-java.

robinst avatar robinst commented on August 16, 2024

Sounds good! I've added a note to the README now, thanks.

(And yeah, Twitter's list is missing some interesting edge cases :).)

from autolink-java.

Related Issues (20)

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.