Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle reserved characters in filepaths #1629

Open
wants to merge 4 commits into
base: master
from
Open
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

Next

1st attempt at fixing invalid filepaths

  • Loading branch information
Jaliborc committed May 14, 2019
commit b95b21754fb0ed1725f69985c1fbae4a736e5cfd
@@ -26,6 +26,7 @@ const uniq = require('uniq')
const utMetadata = require('ut_metadata')
const utPex = require('ut_pex') // browser exclude
const parseRange = require('parse-numeric-range')
const filenameReservedRegex = require('filename-reserved-regex')

const File = require('./file')
const Peer = require('./peer')
@@ -447,6 +448,7 @@ class Torrent extends EventEmitter {
}

this._rarityMap = new RarityMap(this)
this.files.each(file => file.path = file.path.replace(filenameReservedRegex(), '_'))

this.store = new ImmediateChunkStore(
new this._store(this.pieceLength, {
@@ -1,7 +1,7 @@
{
"name": "webtorrent",
"name": "webtorrent-jali",
"description": "Streaming torrent client",
"version": "0.103.1",
"version": "0.103.1+1",
"author": {
"name": "WebTorrent, LLC",
"email": "feross@webtorrent.io",
@@ -23,7 +23,7 @@
]
},
"bugs": {
"url": "https://github.com/webtorrent/webtorrent/issues"
"url": "https://github.com/Jaliborc/webtorrent/issues"
},
"dependencies": {
"addr-to-ip-port": "^1.4.2",
@@ -34,6 +34,7 @@
"create-torrent": "^3.33.0",
"debug": "^4.1.0",
"end-of-stream": "^1.1.0",
"filename-reserved-regex": "^2.0.0",
"fs-chunk-store": "^1.6.2",
"immediate-chunk-store": "^2.0.0",
"load-ip-set": "^2.1.0",
@@ -107,7 +108,7 @@
"main": "index.js",
"repository": {
"type": "git",
"url": "git://github.com/webtorrent/webtorrent.git"
"url": "git://github.com/Jaliborc/webtorrent.git"
},
"scripts": {
"build": "browserify -s WebTorrent -e ./ | minify > webtorrent.min.js",
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.