linkedin / linkedin/URL-Detector

String: 'http://user:pass@host.com host.com' causes exception

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

Description

Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: -2
at java.lang.AbstractStringBuilder.substring(AbstractStringBuilder.java:908)
at java.lang.StringBuilder.substring(StringBuilder.java:76)
at java.lang.AbstractStringBuilder.substring(AbstractStringBuilder.java:854)
at java.lang.StringBuilder.substring(StringBuilder.java:76)
at com.linkedin.urls.detection.UrlDetector.readDefault(UrlDetector.java:191)
at com.linkedin.urls.detection.UrlDetector.detect(UrlDetector.java:142)
at com.mycompany.url.UrlTest.main(UrlTest.java:26)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the reported input and trace detection through UrlDetector.detect to UrlDetector.java:191, where the stack trace shows the exception. Inspect the surrounding URL parsing logic and verify that this input no longer raises StringIndexOutOfBoundsException while detection completes normally.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
networking
Issue type
Bug
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.