| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 61e6d78 commit f2f7d7b
19 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -26,7 +26,7 @@ server.listen(0, common.mustSucceed(() => { | |||
| 26 | 26 | let response = ''; | |
| 27 | 27 | ||
| 28 | 28 | client.on('data', common.mustCall((chunk) => { | |
| 29 | - response += chunk.toString('utf-8'); | ||
| 29 | + response += chunk; | ||
| 30 | 30 | })); | |
| 31 | 31 | ||
| 32 | 32 | client.setEncoding('utf8'); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -31,8 +31,10 @@ server.listen(0, function() { | |||
| 31 | 31 | const client2 = connect(port); | |
| 32 | 32 | let response = ''; | |
| 33 | 33 | ||
| 34 | + client2.setEncoding('utf8'); | ||
| 35 | + | ||
| 34 | 36 | client2.on('data', common.mustCall((chunk) => { | |
| 35 | - response += chunk.toString('utf-8'); | ||
| 37 | + response += chunk; | ||
| 36 | 38 | ||
| 37 | 39 | if (response.endsWith('0\r\n\r\n')) { | |
| 38 | 40 | assert(response.startsWith('HTTP/1.1 200 OK\r\nConnection: keep-alive')); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -33,8 +33,10 @@ server.listen(0, function() { | |||
| 33 | 33 | const client2 = connect(port); | |
| 34 | 34 | let response = ''; | |
| 35 | 35 | ||
| 36 | + client2.setEncoding('utf8'); | ||
| 37 | + | ||
| 36 | 38 | client2.on('data', common.mustCall((chunk) => { | |
| 37 | - response += chunk.toString('utf-8'); | ||
| 39 | + response += chunk; | ||
| 38 | 40 | ||
| 39 | 41 | if (response.endsWith('0\r\n\r\n')) { | |
| 40 | 42 | assert(response.startsWith('HTTP/1.1 200 OK\r\nConnection: keep-alive')); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -33,8 +33,9 @@ server.listen(0, common.mustCall(() => { | |||
| 33 | 33 | const client = connect(server.address().port); | |
| 34 | 34 | let response = ''; | |
| 35 | 35 | ||
| 36 | + client.setEncoding('utf8'); | ||
| 36 | 37 | client.on('data', common.mustCall((chunk) => { | |
| 37 | - response += chunk.toString('utf-8'); | ||
| 38 | + response += chunk; | ||
| 38 | 39 | })); | |
| 39 | 40 | ||
| 40 | 41 | const errOrEnd = common.mustSucceed(function(err) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -33,8 +33,9 @@ server.listen(0, common.mustCall(() => { | |||
| 33 | 33 | const client = connect(server.address().port); | |
| 34 | 34 | let response = ''; | |
| 35 | 35 | ||
| 36 | + client.setEncoding('utf8'); | ||
| 36 | 37 | client.on('data', common.mustCall((chunk) => { | |
| 37 | - response += chunk.toString('utf-8'); | ||
| 38 | + response += chunk; | ||
| 38 | 39 | })); | |
| 39 | 40 | ||
| 40 | 41 | const errOrEnd = common.mustSucceed(function(err) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -47,8 +47,9 @@ server.listen(0, common.mustCall(() => { | |||
| 47 | 47 | let second = false; | |
| 48 | 48 | let response = ''; | |
| 49 | 49 | ||
| 50 | + client.setEncoding('utf8'); | ||
| 50 | 51 | client.on('data', common.mustCallAtLeast((chunk) => { | |
| 51 | - response += chunk.toString('utf-8'); | ||
| 52 | + response += chunk; | ||
| 52 | 53 | ||
| 53 | 54 | // First response has ended | |
| 54 | 55 | if (!second && response.endsWith('\r\n\r\n')) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -33,8 +33,9 @@ server.listen(0, common.mustCall(() => { | |||
| 33 | 33 | let second = false; | |
| 34 | 34 | let response = ''; | |
| 35 | 35 | ||
| 36 | + client.setEncoding('utf8'); | ||
| 36 | 37 | client.on('data', common.mustCallAtLeast((chunk) => { | |
| 37 | - response += chunk.toString('utf-8'); | ||
| 38 | + response += chunk; | ||
| 38 | 39 | ||
| 39 | 40 | // First response has ended | |
| 40 | 41 | if (!second && response.endsWith('\r\n\r\n')) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -40,8 +40,9 @@ server.listen(0, common.mustCall(() => { | |||
| 40 | 40 | const client = connect(server.address().port); | |
| 41 | 41 | let response = ''; | |
| 42 | 42 | ||
| 43 | + client.setEncoding('utf8'); | ||
| 43 | 44 | client.on('data', common.mustCall((chunk) => { | |
| 44 | - response += chunk.toString('utf-8'); | ||
| 45 | + response += chunk; | ||
| 45 | 46 | })); | |
| 46 | 47 | ||
| 47 | 48 | client.resume(); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -28,8 +28,9 @@ server.listen(0, common.mustCall(() => { | |||
| 28 | 28 | const client = connect(server.address().port); | |
| 29 | 29 | let response = ''; | |
| 30 | 30 | ||
| 31 | + client.setEncoding('utf8'); | ||
| 31 | 32 | client.on('data', common.mustCall((chunk) => { | |
| 32 | - response += chunk.toString('utf-8'); | ||
| 33 | + response += chunk; | ||
| 33 | 34 | })); | |
| 34 | 35 | ||
| 35 | 36 | const errOrEnd = common.mustSucceed(function(err) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -40,8 +40,9 @@ server.listen(0, common.mustCall(() => { | |||
| 40 | 40 | const client = connect(server.address().port); | |
| 41 | 41 | let response = ''; | |
| 42 | 42 | ||
| 43 | + client.setEncoding('utf8'); | ||
| 43 | 44 | client.on('data', common.mustCall((chunk) => { | |
| 44 | - response += chunk.toString('utf-8'); | ||
| 45 | + response += chunk; | ||
| 45 | 46 | })); | |
| 46 | 47 | ||
| 47 | 48 | const errOrEnd = common.mustSucceed(function(err) { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments