This repository has been archived by the owner on Apr 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbugReport.txt
45 lines (35 loc) · 1.76 KB
/
bugReport.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
BUGS:
-------------------------------------------------------------------
Solved Bugs:
1) Body length mismatch with Content-Length header
- sending POST request with binary data (text file)
- data sent over multiple chunks
- doing body += chunk for each chunk
- conttent length header is slightly greater than calculated length of body (contentLength, bodyLength 391811 391783)
Solution
- use buffers to concatinate data chunks, not strings
- "You need to set the content length using Buffer.byteLength not string.length."
- https://github.com/expressjs/express/issues/1816
2) Content-length mismatch for .png files
- solved after using buffers
3) res.render('test.html')
res.render('/jjjj')
throws error saying write after socket close. It should give a correct error
- Not a bug, express does the same thing
4) On restarting server, the first request times out:
- it was because methodHandler wasn't being added. Fixed this
5) On sending invalid JSON, currently just logging error to console, and response of 200 OK sent by default
- setting response code 400 and returning error message on encountering error in body parser
6) GET requests through CHROME triggering 'timeout' & giving 'Error: write after end'
- GET request for localhost:3000
- page getting rendered
- all handlers running fine
- socket closes
- after that, getting [server] 408 - Request Timeout
- after some time, getting Error: write after end
- not happening for CURL/Postman/Firefox
Explaination:
- Chrome starts multiple connections for a single request to speed things up and other weird reasons
- ignoring this issue
- removig the 'socket.write' lines in program 'closeSocketWithError' will prevent 'Error: write after end',
and the extra requests will time out