linkedin / linkedin/URL-Detector

Default Scheme on url with no scheme

Open
#14 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
785
Forks
184
PR merge metrics
No merged PRs in 30d

Description

When parsing a URL like "linkedin.com", the url object will add a default scheme of 'http' if one is not detected: [URL.getScheme()](https://github.com/linkedin/URL-Detector/blob/2a0fede05e216c0ede572f7030f1309cd7189f87/url-detector/src/main/java/com/linkedin/urls/Url.java#L137)

I can understand why some defaults were included but it would be nice if this behavior could be configured. I need to know whether the original input text contained the scheme.

I can always do something like url.getOriginalUrl().startsWith(url.getScheme()) but I don't want to have to do that everywhere.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the linked getScheme() implementation in url-detector/src/main/java/com/linkedin/urls/Url.java and trace how a missing scheme is handled during URL parsing. Review nearby parsing behavior before deciding how configurability should fit the library API; done means callers can determine whether the original input contained a scheme without repeating string checks.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.