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

move to node #985

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -41,6 +41,7 @@

# re-ignores: add here what you want to be ignored again
test/tmp
test-node/tmp

# !src/*.js
# !src/*.ts
8 changes: 8 additions & 0 deletions a.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -63,7 +63,8 @@
"test-specific": "node --experimental-vm-modules ./node_modules/jest/bin/jest.js --testPathPattern=test/standalone/keep-alive-error.test.js",
"test": "npm run test-jest && npm run test-node",
"test-jest": "node --experimental-vm-modules ./node_modules/jest/bin/jest.js --testPathPattern=test/ --coverage",
"test-node": "node --test test-node/",
"test-node": "node --test \"test-node/**/*.test.js\" --test-concurrency 1",
"test-node2": "node --test \"test-node/**/integration/**/*.test.js\" --test-concurrency 1",
"pretest:ci": "yarn run pretest",
"test:ci": "node --experimental-vm-modules node_modules/.bin/nyc jest --testPathPattern=test/ --coverage && node --experimental-vm-modules node_modules/.bin/nyc node --test test-node/"
},
4 changes: 2 additions & 2 deletions src/Formidable.js
Original file line number Diff line number Diff line change
@@ -492,11 +492,11 @@ class IncomingForm extends EventEmitter {

this.req = null;
this.error = err;
this.emit(eventName, err);

this.openedFiles.forEach((file) => {
file.destroy();
});
this.emit(eventName, err);

}

_parseContentLength() {
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
1 change: 1 addition & 0 deletions test-node/fixture/file/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
These are the original files that were used to create the files inside http which are like http request header + body in 1 file.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
POST /upload HTTP/1.1
Host: localhost:8080
Content-Type: multipart/form-data; boundary=\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
Content-Length: 2483
--\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
Content-Disposition: form-data; name="sticker"; filename="beta-sticker-1.png"
Content-Type: image/png
Content-Transfer-Encoding: base64
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
--\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/--
POST /upload HTTP/1.1
Host: localhost:8080
Content-Type: multipart/form-data; boundary=\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
Content-Length: 2483

--\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
Content-Disposition: form-data; name="sticker"; filename="beta-sticker-1.png"
Content-Type: image/png
Content-Transfer-Encoding: base64

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
--\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/--
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
POST /upload HTTP/1.1
Host: localhost:8080
Content-Type: multipart/form-data; boundary=\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
Content-Length: 676
--\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
Content-Disposition: form-data; name="file"; filename="binaryfile.tar.gz"
Content-Type: application/x-gzip
Content-Transfer-Encoding: base64
H4sIAGiNIU8AA+3R0W6CMBQGYK59iobLZantRDG73osUOGqnFNJWM2N897UghG1ZdmWWLf93U/jP4bRAq8q92hJ/dY1J7kQEqyyLq8yXYrp2ltkqkTKXYiEykYc++ZTLVcLEvQ40dXReWcYSV1pdnL/v+6n+R11mjKVG1ZQ+s3TT2FpXqjhQ+hjzE1mnGxNLkgu+7tOKWjIVmVKTC6XL9ZaeXj4VQhwKWzL+cI4zwgQuuhkh3mhTad/Hkssh3im3027X54JnQ360R/M19OT8kC7SEN7Ooi2VvrEfznHQRWzl83gxttZKmzGehzPRW/+W8X+3fvL8sFet9sS6m3EIma02071MU3Uf9KHrmV1/+y8DAAAAAAAAAAAAAAAAAAAAAMB/9A6txIuJACgAAA==
--\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/--
POST /upload HTTP/1.1
Host: localhost:8080
Content-Type: multipart/form-data; boundary=\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
Content-Length: 676

--\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
Content-Disposition: form-data; name="file"; filename="binaryfile.tar.gz"
Content-Type: application/x-gzip
Content-Transfer-Encoding: base64

H4sIAGiNIU8AA+3R0W6CMBQGYK59iobLZantRDG73osUOGqnFNJWM2N897UghG1ZdmWWLf93U/jP4bRAq8q92hJ/dY1J7kQEqyyLq8yXYrp2ltkqkTKXYiEykYc++ZTLVcLEvQ40dXReWcYSV1pdnL/v+6n+R11mjKVG1ZQ+s3TT2FpXqjhQ+hjzE1mnGxNLkgu+7tOKWjIVmVKTC6XL9ZaeXj4VQhwKWzL+cI4zwgQuuhkh3mhTad/Hkssh3im3027X54JnQ360R/M19OT8kC7SEN7Ooi2VvrEfznHQRWzl83gxttZKmzGehzPRW/+W8X+3fvL8sFet9sS6m3EIma02071MU3Uf9KHrmV1/+y8DAAAAAAAAAAAAAAAAAAAAAMB/9A6txIuJACgAAA==
--\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/--
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
POST /upload HTTP/1.1
Host: localhost:8080
Content-Type: multipart/form-data; boundary=\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
Content-Length: 323
--\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
Content-Disposition: form-data; name="file"; filename="blank.gif"
Content-Type: image/gif
Content-Transfer-Encoding: base64
R0lGODlhAQABAJH/AP///wAAAMDAwAAAACH5BAEAAAIALAAAAAABAAEAAAICVAEAOw==
--\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/--
POST /upload HTTP/1.1
Host: localhost:8080
Content-Type: multipart/form-data; boundary=\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
Content-Length: 323

--\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
Content-Disposition: form-data; name="file"; filename="blank.gif"
Content-Type: image/gif
Content-Transfer-Encoding: base64

R0lGODlhAQABAJH/AP///wAAAMDAwAAAACH5BAEAAAIALAAAAAABAAEAAAICVAEAOw==
--\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/--
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
POST /upload HTTP/1.1
Host: localhost:8080
Content-Type: multipart/form-data; boundary=----TLV0SrKD4z1TRxRhAPUvZ
Content-Length: 221
------TLV0SrKD4z1TRxRhAPUvZ
Content-Disposition: form-data; name="file"; filename="plain.txt"
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
POST /upload HTTP/1.1
Host: localhost:8080
Content-Type: multipart/form-data; boundary=----TLV0SrKD4z1TRxRhAPUvZ
Content-Length: 221

------TLV0SrKD4z1TRxRhAPUvZ
Content-Disposition: form-data; name="file"; filename="plain.txt"
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

I am a plain text file
------TLV0SrKD4z1TRxRhAPUvZ--

------TLV0SrKD4z1TRxRhAPUvZ--
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
POST /upload HTTP/1.1
Host: localhost:8080
Content-Type: multipart/form-data; boundary=----TLV0SrKD4z1TRxRhAPUvZ
Content-Length: 0
POST /upload HTTP/1.1
Host: localhost:8080
Content-Type: multipart/form-data; boundary=----TLV0SrKD4z1TRxRhAPUvZ
Content-Length: 0

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
POST /upload HTTP/1.1
Host: localhost:8080
Content-Type: multipart/form-data; boundary=----TLV0SrKD4z1TRxRhAPUvZ
Content-Length: 31
------TLV0SrKD4z1TRxRhAPUvZ--
POST /upload HTTP/1.1
Host: localhost:8080
Content-Type: multipart/form-data; boundary=----TLV0SrKD4z1TRxRhAPUvZ
Content-Length: 31

------TLV0SrKD4z1TRxRhAPUvZ--
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
POST /upload HTTP/1.1
Host: localhost:8080
Content-Length: 0
Content-Type: application/x-www-form-urlencoded
POST /upload HTTP/1.1
Host: localhost:8080
Content-Length: 0
Content-Type: application/x-www-form-urlencoded

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
POST /upload HTTP/1.1
Host: localhost:8080
Content-Length: 0
POST /upload HTTP/1.1
Host: localhost:8080
Content-Length: 0

Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
POST /upload HTTP/1.1
Host: localhost:8080
POST /upload HTTP/1.1
Host: localhost:8080

Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
POST /upload HTTP/1.1
Host: localhost:8080
Content-Type: multipart/form-data; boundary=----WebKitFormBoundarytyE4wkKlZ5CQJVTG
Content-Length: 1000
------WebKitFormBoundarytyE4wkKlZ5CQJVTG
Content-Disposition: form-data; filename="plain.txt"; name="upload"
Content-Type: text/plain
I am a plain text file
------WebKitFormBoundarytyE4wkKlZ5CQJVTG--
POST /upload HTTP/1.1
Host: localhost:8080
Content-Type: multipart/form-data; boundary=----WebKitFormBoundarytyE4wkKlZ5CQJVTG
Content-Length: 1000

------WebKitFormBoundarytyE4wkKlZ5CQJVTG
Content-Disposition: form-data; filename="plain.txt"; name="upload"
Content-Type: text/plain

I am a plain text file

------WebKitFormBoundarytyE4wkKlZ5CQJVTG--

Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
POST /upload HTTP/1.1
Host: localhost:8080
Content-Type: multipart/form-data; boundary=----WebKitFormBoundarytyE4wkKlZ5CQJVTG
Content-Length: 1000
------WebKitFormBoundarytyE4wkKlZ5CQJVTG
Content-Disposition: form-data; name="upload"; filename=""
Content-Type: text/plain
POST /upload HTTP/1.1
Host: localhost:8080
Content-Type: multipart/form-data; boundary=----WebKitFormBoundarytyE4wkKlZ5CQJVTG
Content-Length: 1000

------WebKitFormBoundarytyE4wkKlZ5CQJVTG
Content-Disposition: form-data; name="upload"; filename=""
Content-Type: text/plain

I am a plain text file
------WebKitFormBoundarytyE4wkKlZ5CQJVTG--

------WebKitFormBoundarytyE4wkKlZ5CQJVTG--

Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
POST /upload HTTP/1.1
Host: localhost:8080
Content-Type: multipart/form-data; boundary=----TLV0SrKD4z1TRxRhAPUvZ
Content-Length: 184
------TLV0SrKD4z1TRxRhAPUvZ
Content-Disposition: form-data; name="upload"; filename="plain.txt"
Content-Type: text/plain
POST /upload HTTP/1.1
Host: localhost:8080
Content-Type: multipart/form-data; boundary=----TLV0SrKD4z1TRxRhAPUvZ
Content-Length: 184


------TLV0SrKD4z1TRxRhAPUvZ
Content-Disposition: form-data; name="upload"; filename="plain.txt"
Content-Type: text/plain

I am a plain text file
------TLV0SrKD4z1TRxRhAPUvZ--

------TLV0SrKD4z1TRxRhAPUvZ--
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
POST /upload HTTP/1.1
Host: localhost:8080
Content-Type: multipart/form-data; boundary=----TLV0SrKD4z1TRxRhAPUvZ
Content-Length: 226
This is a preamble which should be ignored
------TLV0SrKD4z1TRxRhAPUvZ
Content-Disposition: form-data; name="upload"; filename="plain.txt"
Content-Type: text/plain
I am a plain text file
------TLV0SrKD4z1TRxRhAPUvZ--
POST /upload HTTP/1.1
Host: localhost:8080
Content-Type: multipart/form-data; boundary=----TLV0SrKD4z1TRxRhAPUvZ
Content-Length: 226

This is a preamble which should be ignored
------TLV0SrKD4z1TRxRhAPUvZ
Content-Disposition: form-data; name="upload"; filename="plain.txt"
Content-Type: text/plain

I am a plain text file

------TLV0SrKD4z1TRxRhAPUvZ--
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
POST /upload HTTP/1.1
Host: localhost:8080
Connection: keep-alive
Referer: http://localhost:8080/
Content-Length: 383
Cache-Control: max-age=0
Origin: http://localhost:8080
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.220 Safari/535.1
Content-Type: multipart/form-data; boundary=----WebKitFormBoundarytyE4wkKlZ5CQJVTG
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: jqCookieJar_tablesorter=%7B%22showListTable%22%3A%5B%5B5%2C1%5D%2C%5B1%2C0%5D%5D%7D
------WebKitFormBoundarytyE4wkKlZ5CQJVTG
Content-Disposition: form-data; name="title"
Weird filename
------WebKitFormBoundarytyE4wkKlZ5CQJVTG
Content-Disposition: form-data; name="upload"; filename=": \ ? % * | %22 < > . ? ; ' @ # $ ^ & ( ) - _ = + { } [ ] ` ~.txt"
Content-Type: text/plain
POST /upload HTTP/1.1
Host: localhost:8080
Connection: keep-alive
Referer: http://localhost:8080/
Content-Length: 383
Cache-Control: max-age=0
Origin: http://localhost:8080
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.220 Safari/535.1
Content-Type: multipart/form-data; boundary=----WebKitFormBoundarytyE4wkKlZ5CQJVTG
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: jqCookieJar_tablesorter=%7B%22showListTable%22%3A%5B%5B5%2C1%5D%2C%5B1%2C0%5D%5D%7D

------WebKitFormBoundarytyE4wkKlZ5CQJVTG
Content-Disposition: form-data; name="title"

Weird filename
------WebKitFormBoundarytyE4wkKlZ5CQJVTG
Content-Disposition: form-data; name="upload"; filename=": \ ? % * | %22 < > . ? ; ' @ # $ ^ & ( ) - _ = + { } [ ] ` ~.txt"
Content-Type: text/plain

I am a text file with a funky name!
------WebKitFormBoundarytyE4wkKlZ5CQJVTG--

------WebKitFormBoundarytyE4wkKlZ5CQJVTG--
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
POST /upload HTTP/1.1
Host: localhost:8080
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.22) Gecko/20110902 Firefox/3.6.22
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Referer: http://localhost:8080/
Content-Type: multipart/form-data; boundary=---------------------------9849436581144108930470211272
Content-Length: 438

-----------------------------9849436581144108930470211272
Content-Disposition: form-data; name="title"

Weird filename
-----------------------------9849436581144108930470211272
Content-Disposition: form-data; name="upload"; filename=": \ ? % * | " < > . &#9731; ; ' @ # $ ^ & ( ) - _ = + { } [ ] ` ~.txt"
Content-Type: text/plain

POST /upload HTTP/1.1
Host: localhost:8080
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.22) Gecko/20110902 Firefox/3.6.22
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Referer: http://localhost:8080/
Content-Type: multipart/form-data; boundary=---------------------------9849436581144108930470211272
Content-Length: 438

-----------------------------9849436581144108930470211272
Content-Disposition: form-data; name="title"

Weird filename
-----------------------------9849436581144108930470211272
Content-Disposition: form-data; name="upload"; filename=": \ ? % * | " < > . &#9731; ; ' @ # $ ^ & ( ) - _ = + { } [ ] ` ~.txt"
Content-Type: text/plain

I am a text file with a funky name!

-----------------------------9849436581144108930470211272--

-----------------------------9849436581144108930470211272--
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
POST /upload HTTP/1.1
Host: localhost:8080
Origin: http://localhost:8080
Content-Length: 383
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_8; en-us) AppleWebKit/533.21.1 (KHTML, like Gecko) Version/5.0.5 Safari/533.21.1
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryQJZ1gvhvdgfisJPJ
Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Referer: http://localhost:8080/
Accept-Language: en-us
Accept-Encoding: gzip, deflate
Connection: keep-alive

------WebKitFormBoundaryQJZ1gvhvdgfisJPJ
Content-Disposition: form-data; name="title"

Weird filename
------WebKitFormBoundaryQJZ1gvhvdgfisJPJ
Content-Disposition: form-data; name="upload"; filename=": \ ? % * | %22 < > . ? ; ' @ # $ ^ & ( ) - _ = + { } [ ] ` ~.txt"
Content-Type: text/plain

POST /upload HTTP/1.1
Host: localhost:8080
Origin: http://localhost:8080
Content-Length: 383
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_8; en-us) AppleWebKit/533.21.1 (KHTML, like Gecko) Version/5.0.5 Safari/533.21.1
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryQJZ1gvhvdgfisJPJ
Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Referer: http://localhost:8080/
Accept-Language: en-us
Accept-Encoding: gzip, deflate
Connection: keep-alive

------WebKitFormBoundaryQJZ1gvhvdgfisJPJ
Content-Disposition: form-data; name="title"

Weird filename
------WebKitFormBoundaryQJZ1gvhvdgfisJPJ
Content-Disposition: form-data; name="upload"; filename=": \ ? % * | %22 < > . ? ; ' @ # $ ^ & ( ) - _ = + { } [ ] ` ~.txt"
Content-Type: text/plain

I am a text file with a funky name!

------WebKitFormBoundaryQJZ1gvhvdgfisJPJ--

------WebKitFormBoundaryQJZ1gvhvdgfisJPJ--
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
POST /upload HTTP/1.1
Host: 192.168.56.1:8080
Connection: keep-alive
Referer: http://192.168.56.1:8080/
Content-Length: 344
Cache-Control: max-age=0
Origin: http://192.168.56.1:8080
User-Agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.122 Safari/534.30
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryEvqBNplR3ByrwQPa
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip,deflate,sdch
Accept-Language: de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3

------WebKitFormBoundaryEvqBNplR3ByrwQPa
Content-Disposition: form-data; name="title"

Weird filename
------WebKitFormBoundaryEvqBNplR3ByrwQPa
Content-Disposition: form-data; name="upload"; filename=" ? % * | %22 < > . ? ; ' @ # $ ^ & ( ) - _ = + { } [ ] ` ~.txt"
Content-Type: text/plain


------WebKitFormBoundaryEvqBNplR3ByrwQPa--
POST /upload HTTP/1.1
Host: 192.168.56.1:8080
Connection: keep-alive
Referer: http://192.168.56.1:8080/
Content-Length: 344
Cache-Control: max-age=0
Origin: http://192.168.56.1:8080
User-Agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.122 Safari/534.30
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryEvqBNplR3ByrwQPa
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip,deflate,sdch
Accept-Language: de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3

------WebKitFormBoundaryEvqBNplR3ByrwQPa
Content-Disposition: form-data; name="title"

Weird filename
------WebKitFormBoundaryEvqBNplR3ByrwQPa
Content-Disposition: form-data; name="upload"; filename=" ? % * | %22 < > . ? ; ' @ # $ ^ & ( ) - _ = + { } [ ] ` ~.txt"
Content-Type: text/plain


------WebKitFormBoundaryEvqBNplR3ByrwQPa--
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
POST /upload HTTP/1.1
Accept: image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwave-flash, */*
Referer: http://192.168.56.1:8080/
Accept-Language: de
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)
Content-Type: multipart/form-data; boundary=---------------------------7db1fe232017c
Accept-Encoding: gzip, deflate
Host: 192.168.56.1:8080
Content-Length: 368
Connection: Keep-Alive
Cache-Control: no-cache

-----------------------------7db1fe232017c
Content-Disposition: form-data; name="title"

Weird filename
-----------------------------7db1fe232017c
Content-Disposition: form-data; name="upload"; filename=" ? % * | " < > . &#9731; ; ' @ # $ ^ & ( ) - _ = + { } [ ] ` ~.txt"
Content-Type: application/octet-stream


-----------------------------7db1fe232017c--
POST /upload HTTP/1.1
Accept: image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwave-flash, */*
Referer: http://192.168.56.1:8080/
Accept-Language: de
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)
Content-Type: multipart/form-data; boundary=---------------------------7db1fe232017c
Accept-Encoding: gzip, deflate
Host: 192.168.56.1:8080
Content-Length: 368
Connection: Keep-Alive
Cache-Control: no-cache

-----------------------------7db1fe232017c
Content-Disposition: form-data; name="title"

Weird filename
-----------------------------7db1fe232017c
Content-Disposition: form-data; name="upload"; filename=" ? % * | " < > . &#9731; ; ' @ # $ ^ & ( ) - _ = + { } [ ] ` ~.txt"
Content-Type: application/octet-stream


-----------------------------7db1fe232017c--
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
POST /upload HTTP/1.1
Accept: image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwave-flash, */*
Referer: http://192.168.56.1:8080/
Accept-Language: de
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)
Content-Type: multipart/form-data; boundary=---------------------------7db3a8372017c
Accept-Encoding: gzip, deflate
Host: 192.168.56.1:8080
Content-Length: 368
Connection: Keep-Alive
Cache-Control: no-cache

-----------------------------7db3a8372017c
Content-Disposition: form-data; name="title"

Weird filename
-----------------------------7db3a8372017c
Content-Disposition: form-data; name="upload"; filename=" ? % * | " < > . &#9731; ; ' @ # $ ^ & ( ) - _ = + { } [ ] ` ~.txt"
Content-Type: application/octet-stream


-----------------------------7db3a8372017c--
POST /upload HTTP/1.1
Accept: image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwave-flash, */*
Referer: http://192.168.56.1:8080/
Accept-Language: de
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)
Content-Type: multipart/form-data; boundary=---------------------------7db3a8372017c
Accept-Encoding: gzip, deflate
Host: 192.168.56.1:8080
Content-Length: 368
Connection: Keep-Alive
Cache-Control: no-cache

-----------------------------7db3a8372017c
Content-Disposition: form-data; name="title"

Weird filename
-----------------------------7db3a8372017c
Content-Disposition: form-data; name="upload"; filename=" ? % * | " < > . &#9731; ; ' @ # $ ^ & ( ) - _ = + { } [ ] ` ~.txt"
Content-Type: application/octet-stream


-----------------------------7db3a8372017c--
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
POST /upload HTTP/1.1
Host: 192.168.56.1:8080
Referer: http://192.168.56.1:8080/
Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-US
Origin: http://192.168.56.1:8080
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/533.19.4 (KHTML, like Gecko) Version/5.0.3 Safari/533.19.4
Accept-Encoding: gzip, deflate
Content-Type: multipart/form-data; boundary=----WebKitFormBoundarykmaWSUbu697WN9TM
Content-Length: 344
Connection: keep-alive

------WebKitFormBoundarykmaWSUbu697WN9TM
Content-Disposition: form-data; name="title"

Weird filename
------WebKitFormBoundarykmaWSUbu697WN9TM
Content-Disposition: form-data; name="upload"; filename=" ? % * | %22 < > . ? ; ' @ # $ ^ & ( ) - _ = + { } [ ] ` ~.txt"
Content-Type: text/plain


------WebKitFormBoundarykmaWSUbu697WN9TM--
POST /upload HTTP/1.1
Host: 192.168.56.1:8080
Referer: http://192.168.56.1:8080/
Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-US
Origin: http://192.168.56.1:8080
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/533.19.4 (KHTML, like Gecko) Version/5.0.3 Safari/533.19.4
Accept-Encoding: gzip, deflate
Content-Type: multipart/form-data; boundary=----WebKitFormBoundarykmaWSUbu697WN9TM
Content-Length: 344
Connection: keep-alive

------WebKitFormBoundarykmaWSUbu697WN9TM
Content-Disposition: form-data; name="title"

Weird filename
------WebKitFormBoundarykmaWSUbu697WN9TM
Content-Disposition: form-data; name="upload"; filename=" ? % * | %22 < > . ? ; ' @ # $ ^ & ( ) - _ = + { } [ ] ` ~.txt"
Content-Type: text/plain


------WebKitFormBoundarykmaWSUbu697WN9TM--
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
POST /upload HTTP/1.1
Host: localhost:8080
Content-Type: multipart/form-data; boundary=----TLV0SrKD4z1TRxRhAPUvZ
Content-Length: 189

------TLV0SrKD4z1TRxRhAPUvZ
Content-Disposition: form-data; name="upload"; filename="plain.txt"
Content-Type: text/plain

I am a simple plain text file

------TLV0SrKD4z1TRxRhAPUvZ
POST /upload HTTP/1.1
Host: localhost:8080
Content-Type: multipart/form-data; boundary=----TLV0SrKD4z1TRxRhAPUvZ
Content-Length: 189

------TLV0SrKD4z1TRxRhAPUvZ
Content-Disposition: form-data; name="upload"; filename="plain.txt"
Content-Type: text/plain

I am a simple plain text file

------TLV0SrKD4z1TRxRhAPUvZ
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
POST /upload HTTP/1.1
Host: localhost:8080
Content-Type: multipart/form-data; boundary=----TLVx0SrKD4z1TRxRhAPUvZx
Content-Length: 209

------TLVx0SrKD4z1TRxRhAPUvZx
Content-Disposition: form-data; name="upload"; filename="second-plaintext.txt"
Content-Type: text/plain

Some another plain text file, yeah!

------TLVx0SrKD4z1TRxRhAPUvZx
POST /upload HTTP/1.1
Host: localhost:8080
Content-Type: multipart/form-data; boundary=----TLVx0SrKD4z1TRxRhAPUvZx
Content-Length: 209

------TLVx0SrKD4z1TRxRhAPUvZx
Content-Disposition: form-data; name="upload"; filename="second-plaintext.txt"
Content-Type: text/plain

Some another plain text file, yeah!

------TLVx0SrKD4z1TRxRhAPUvZx
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ const missing_hyphens1_http = [
type: 'file',
name: 'upload',
originalFilename: 'plain.txt',
fixture: 'missing-hyphens1',
fixture: 'missing-hyphens1.txt',
sha1: '8c26b82ec9107e99b3486844644e92558efe0c73',
},
];
@@ -13,9 +13,12 @@ const missing_hyphens2_http = [
type: 'file',
name: 'upload',
originalFilename: 'second-plaintext.txt',
fixture: 'missing-hyphens2',
fixture: 'missing-hyphens2.txt',
sha1: '798e39a4a1034232ed26e0aadd67f5d1ff10b966',
},
];

export { missing_hyphens1_http, missing_hyphens2_http };
export {
missing_hyphens1_http,
// missing_hyphens2_http,
};
File renamed without changes.
File renamed without changes.
175 changes: 175 additions & 0 deletions test-node/integration/fixtures.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
/* eslint-disable global-require */
/* eslint-disable import/no-dynamic-require */

import { strictEqual, deepEqual } from 'node:assert';
import test from 'node:test';
import { createReadStream, constants, accessSync } from 'node:fs';
import { createConnection } from 'node:net';
import { join } from 'node:path';
import { createServer } from 'node:http';
import { pipeline } from 'node:stream';
import formidable from '../../src/index.js';


const PORT = 13534;
const CWDTest = join(process.cwd(), "test-node");
const FIXTURES_HTTP = join(CWDTest, 'fixture', 'http');
const UPLOAD_DIR = join(CWDTest, 'tmp');
import * as encoding from "../fixture/js/encoding.js";
import * as misc from "../fixture/js/misc.js";
import * as noFilename from "../fixture/js/no-filename.js";
import * as preamble from "../fixture/js/preamble.js";
import * as workarounds from "../fixture/js/workarounds.js";
import * as specialCharsInFilename from "../fixture/js/special-chars-in-filename.js";

const fixtures = {
encoding,
// misc,
// [`no-filename`]: noFilename,
// preamble,
// [`special-chars-in-filename`]: specialCharsInFilename,
// workarounds, // todo uncomment this and make it work
};


test('fixtures', (testContext, done) => {
const server = createServer();
server.listen(PORT, findFixtures);

function properExitTest(...x) {
server.close();
done(...x)
}
function strictEqualExit(...x) {
try {
strictEqual(...x)
} catch (assertionError) {
properExitTest(assertionError);
throw assertionError;
}
}


function findFixtures() {
const remainingFixtures = Object.entries(fixtures).map(([fixtureGroup, fixture]) => {
return Object.entries(fixture).map(([k, v]) => {
return v.map(details => {

return {
fixture: v,
name: `${fixtureGroup}/${details.fixture}.http`,
http: join(FIXTURES_HTTP, fixtureGroup, `${details.fixture}.http`),
};
});
});
}).flat(Infinity);
testNext(remainingFixtures);
}

function testNext(remainingFixtures) {
const fixtureWithName = remainingFixtures.shift();
if (!fixtureWithName) {
properExitTest();
return;
}
const fixtureName = fixtureWithName.name;
const fixture = fixtureWithName.fixture;

uploadFixture(fixtureWithName, (err, parts) => {
if (err) {
err.fixtureName = fixtureName;
properExitTest(new Error(err));
return;
}

fixture.forEach((expectedPart, i) => {
const parsedPart = parts[i];
strictEqualExit(parsedPart.type, expectedPart.type);
strictEqualExit(parsedPart.name, expectedPart.name);

if (parsedPart.type === 'file') {
const file = parsedPart.value;
strictEqualExit(file.originalFilename, expectedPart.originalFilename,
`${JSON.stringify([expectedPart, file])}`);

if (expectedPart.sha1) {
strictEqualExit(
file.hash,
expectedPart.sha1,
`SHA1 error ${file.originalFilename} on ${file.filepath} ${JSON.stringify([expectedPart, file])}`,
);
}
}
});

testNext(remainingFixtures);
});
}

function uploadFixture(fixtureWithName, verifyFixture) {

const fixturePath = fixtureWithName.http;
let verifyFixtureOnce = verifyFixture;

try {
accessSync(fixturePath, constants.W_OK | constants.R_OK);
} catch (err) {
properExitTest(new Error(`can't open ${fixturePath}`));
}
const socket = createConnection(PORT);
const file = createReadStream(fixturePath);

// make sure verifyFixture is only called once
function callback(...args) {
const realCallback = verifyFixtureOnce;
verifyFixtureOnce = function callbackFn() { };
if (socket.writable) {
socket.destroy();
}
realCallback(...args);
}

server.once('request', (req, res) => {
const form = formidable({
uploadDir: UPLOAD_DIR,
hashAlgorithm: 'sha1',
keepExtensions: true,
});

const parts = [];
form
.once('error', (error) => {
const a = form;
const b = a;
const c = a._parser.explain();
console.log(c);
callback(error);
})
.on('fileBegin', (name, value) => {
parts.push({ type: 'file', name, value });
})
.on('field', (name, value) => {
parts.push({ type: 'field', name, value });
})
.once('end', () => {
res.end();
callback(null, parts);
});
form.parse(req);
});


// file.pipe(socket, {end: true});
pipeline(
file,
socket,
(err) => {
if (err) {
console.error('error');
} else {
console.log("success")
}
},
);
}
});
131 changes: 0 additions & 131 deletions test/integration/fixtures.test.js

This file was deleted.