| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 275a8f9 commit 6adcc6f
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -648,7 +648,7 @@ class Http2ServerResponse extends Stream { | |||
| 648 | 648 | ||
| 649 | 649 | if ((state.closed || state.ending) && | |
| 650 | 650 | state.headRequest === stream.headRequest) { | |
| 651 | - return false; | ||
| 651 | + return this; | ||
| 652 | 652 | } | |
| 653 | 653 | ||
| 654 | 654 | if (typeof chunk === 'function') { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -60,6 +60,34 @@ const { | |||
| 60 | 60 | })); | |
| 61 | 61 | } | |
| 62 | 62 | ||
| 63 | + { | ||
| 64 | + // Http2ServerResponse.end should return self after end | ||
| 65 | + const server = createServer(mustCall((request, response) => { | ||
| 66 | + strictEqual(response, response.end()); | ||
| 67 | + strictEqual(response, response.end()); | ||
| 68 | + server.close(); | ||
| 69 | + })); | ||
| 70 | + server.listen(0, mustCall(() => { | ||
| 71 | + const { port } = server.address(); | ||
| 72 | + const url = `http://localhost:${port}`; | ||
| 73 | + const client = connect(url, mustCall(() => { | ||
| 74 | + const headers = { | ||
| 75 | + ':path': '/', | ||
| 76 | + ':method': 'GET', | ||
| 77 | + ':scheme': 'http', | ||
| 78 | + ':authority': `localhost:${port}` | ||
| 79 | + }; | ||
| 80 | + const request = client.request(headers); | ||
| 81 | + request.setEncoding('utf8'); | ||
| 82 | + request.on('end', mustCall(() => { | ||
| 83 | + client.close(); | ||
| 84 | + })); | ||
| 85 | + request.end(); | ||
| 86 | + request.resume(); | ||
| 87 | + })); | ||
| 88 | + })); | ||
| 89 | + } | ||
| 90 | + | ||
| 63 | 91 | { | |
| 64 | 92 | // Http2ServerResponse.end can omit encoding arg, sets it to utf-8 | |
| 65 | 93 | const server = createServer(mustCall((request, response) => { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments