Skip to content

Commit

Permalink
Fix bad logic
Browse files Browse the repository at this point in the history
  • Loading branch information
devoxin committed Dec 1, 2023
1 parent c1c41f4 commit 1857be0
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,9 @@ public InputStream getNextSegmentStream(HttpInterface httpInterface) {

protected boolean isAbsoluteUrl(String url) {
try {
// We only want to return false here if we have a baseUrl (for converting relative URLs)
// and the provided url is incomplete (relative).
return this.baseUrl != null || new URI(url).isAbsolute();
// A URL is considered absolute if we don't have a baseUrl (so cannot convert a relative URL)
// or if URI#isAbsolute returns true.
return this.baseUrl == null || new URI(url).isAbsolute();
} catch (URISyntaxException e) {
return false;
}
Expand Down

0 comments on commit 1857be0

Please sign in to comment.