Skip to content

Commit

Permalink
Removed encoding for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Eltik committed Jul 2, 2023
1 parent 737f365 commit e2a6542
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,5 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm install
- run: npm run build:ts
#- run: npm test
4 changes: 2 additions & 2 deletions dist/libraries/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ async function proxyM3U8(url, headers, res) {
if (line.startsWith("#")) {
if (line.startsWith("#EXT-X-KEY:")) {
const regex = /https?:\/\/[^\""\s]+/g;
const url = `${web_server_url}/${encodeURIComponent(web_server_url)}${"/ts-proxy?url=" + encodeURIComponent(regex.exec(line)?.[0] ?? "") + "&headers=" + encodeURIComponent(JSON.stringify(headers))}`;
const url = `${web_server_url}/${web_server_url}${"/ts-proxy?url=" + encodeURIComponent(regex.exec(line)?.[0] ?? "") + "&headers=" + encodeURIComponent(JSON.stringify(headers))}`;
newLines.push(line.replace(regex, url));
}
else {
Expand All @@ -570,7 +570,7 @@ async function proxyM3U8(url, headers, res) {
// CORS is needed since the TS files are not on the same domain as the client.
// This replaces each TS file to use a TS proxy with the headers attached.
// So each TS request will use the headers inputted to the proxy
newLines.push(`${web_server_url}/${encodeURIComponent(web_server_url)}${"/ts-proxy?url=" + encodeURIComponent(uri.href) + "&headers=" + encodeURIComponent(JSON.stringify(headers))}`);
newLines.push(`${web_server_url}/${web_server_url}${"/ts-proxy?url=" + encodeURIComponent(uri.href) + "&headers=" + encodeURIComponent(JSON.stringify(headers))}`);
}
}
// Removes headers that are not needed for the client.
Expand Down
Loading

0 comments on commit e2a6542

Please sign in to comment.