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 a48590d commit f784373
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,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 f784373

Please sign in to comment.