Skip to content

Commit

Permalink
Define corsProxy when handling .pls files (#7)
Browse files Browse the repository at this point in the history
- `corsProxy` is undefined when URL extension is `.pls`
- so use `getProxyURL` before fetching
  • Loading branch information
davidpaulhunt authored and TooTallNate committed Jan 29, 2019
1 parent 3c116d1 commit 5f7cc1d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ async function streamURL(_station, options) {

if ('.pls' === extname(url).toLowerCase()) {
debug('attempting to resolve "pls" file %o', url);
const corsProxy = getProxyURL(options);
const res = await fetch(`${corsProxy}${url}`);
const body = parseIni(await res.text());
debug('pls file: %O', body);
Expand Down

0 comments on commit 5f7cc1d

Please sign in to comment.