Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [3.0.14](https://github.com/webtorrent/webtorrent/compare/v3.0.13...v3.0.14) (2026-05-28)


### Bug Fixes

* http server encoding ([#3064](https://github.com/webtorrent/webtorrent/issues/3064)) ([9c5b70d](https://github.com/webtorrent/webtorrent/commit/9c5b70d5136f17c5537fece13a0805b859410481))

## [3.0.13](https://github.com/webtorrent/webtorrent/compare/v3.0.12...v3.0.13) (2026-05-27)


Expand Down
2 changes: 1 addition & 1 deletion dist/webtorrent.chromeapp.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/webtorrent.chromeapp.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/webtorrent.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/webtorrent.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export default class File extends EventEmitter {

get streamURL () {
if (!this._client._server) throw new Error('No server created')
return `${this._client._server.pathname}/${this._torrent.infoHash}/${this.path}`
return `${this._client._server.pathname}/${this._torrent.infoHash}/${this.path.split('/').map(encodeURIComponent).join('/')}`
}

streamTo (elem) {
Expand Down
4 changes: 2 additions & 2 deletions lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class ServerBase {
const listHtml = torrent.files
.map(file => (
`<li>
<a href="${escapeHtml(pathname)}/${torrent.infoHash}/${escapeHtml(file.path)}">
<a href="${escapeHtml(file.streamURL)}">
${escapeHtml(file.path)}
</a>
(${escapeHtml(file.length)} bytes)
Expand Down Expand Up @@ -211,7 +211,7 @@ class ServerBase {
}

let [infoHash, ...filePath] = pathname.split('/')
filePath = decodeURI(filePath.join('/'))
filePath = decodeURIComponent(filePath.join('/'))

const torrent = await this.client.get(infoHash)
if (!infoHash || !torrent) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "webtorrent",
"description": "Streaming torrent client",
"version": "3.0.13",
"version": "3.0.14",
"author": {
"name": "WebTorrent LLC",
"email": "feross@webtorrent.io",
Expand Down
Loading