1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-01 09:24:20 -04:00
Commit graph

61 commits

Author SHA1 Message Date
Aaron O'Mullan
3c88dffd32
fix(http): panic when responding to a closed conn (#12216)
Our oneshot receiver in `HyperService::call` would unwrap and panic, the `.await` on the oneshot receiver happens when the sender is dropped.

The sender is dropped in `op_http_response` because:
1. We take `ResponseSenderResource`
2. Then get `ConnResource` and early exit on failure (conn already closed)
3. The taken sender then gets dropped in this early exit before any response is sent over the channel

Fallbacking to returning a dummy response to hyper seems to be a fine quickfix
2021-09-25 13:22:19 +02:00
Ben Noordhuis
16ea39ee48
fix(ext/http): fortify "is websocket?" check (#12179)
Check for expected headers more rigorously and check that it's a
HTTP/1.1 GET request. The logic mirrors what Deno Deploy and the
tungstenite crate do.

The presence of "Sec-Websocket-Version: 13" is now also enforced.
I don't expect that to break anything: conforming clients already
send it and tungstenite can't talk to older clients anyway.

The new code is more efficient due to heap-allocating less and aligns
more closely with the checks in ext/http/01_http.js now.
2021-09-25 10:02:26 +02:00
Luca Casonato
fcd0992dba
fix: move unstable declarations to deno.unstable (#11876) 2021-08-31 11:25:15 +02:00
Bartek Iwańczuk
d1d2388d7f
test(ext/http): add test for incomplete HTTP message and fix resource leak (#11717)
This commit adds a test case for "Http: connection closed before
message completed" error as well as fixing an edge with resource
leak when the error is raised.
2021-08-16 13:43:43 +02:00
Aaron O'Mullan
2ca454b402
refactor(ops): return BadResource errors in ResourceTable calls (#11710)
* refactor(ops): return BadResource errors in ResourceTable calls

Instead of relying on callers to map Options to Results via `.ok_or_else(bad_resource_id)` at over 176 different call sites ...
2021-08-15 13:29:19 +02:00
Aaron O'Mullan
18ff6bb053
perf(ext/http): faster req_url string assembly (#11711)
This stood out on a flamegraph, it took up ~1% of a profiled loadtest of `cli/bench/deno_http_native.js`
2021-08-15 12:25:16 +02:00
Aaron O'Mullan
c87b13e745
cleanup(ext/http): simplify cookie header handling (#11704)
cleanup(ext/http): simplify cookie header handling

Use `Vec::join` instead of essentially reimplementing it. There should be no meaningful performance delta
2021-08-14 14:35:58 +02:00
Aaron O'Mullan
8fa46a7b44
cleanup(ext/http): simplify op_http_request_next (#11691)
* cleanup(ext/http): simplify op_http_request_next

Keep op_http_request_next's high-level logic simple, factor out NextRequestResponse building to prepare_next_request() for improved readability & maintainability

* cleanup(ext/http): break prepare_next_request() into meaningful sub-funcs
2021-08-14 13:25:05 +02:00
Leo K
0c9d6cbb2a
fix(http/ws): support multiple options in connection header (#11675)
Co-authored-by: Luca Casonato <hello@lcas.dev>
2021-08-13 20:52:13 +02:00
Bartek Iwańczuk
2937f02f00
fix(ext/http): remove unwrap() when HTTP conn errors (#11674) 2021-08-13 12:07:05 +02:00
Ryan Dahl
a0285e2eb8
Rename extensions/ directory to ext/ (#11643) 2021-08-11 12:27:05 +02:00
Renamed from extensions/http/lib.rs (Browse further)