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

feat(ClientRequest): use net.Socket interceptor #515

Merged
merged 82 commits into from
Jul 4, 2024
Merged
Changes from 1 commit
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
b0f0e37
feat: implement socket interceptor
kettanaito Mar 3, 2024
4f48ecd
chore: guard against missing streams
kettanaito Mar 3, 2024
ac28a3c
chore: replay all suppressed events
kettanaito Mar 3, 2024
6053cfc
fix: respect auth, content-length assumption
kettanaito Mar 3, 2024
f8294ad
fix: set "credentials" to "same-origin"
kettanaito Mar 3, 2024
b9be9e6
chore: import order
kettanaito Mar 3, 2024
d8a6075
fix: always set request body stream if allowed
kettanaito Mar 3, 2024
0a67263
feat: implement "respondWith()"
kettanaito Mar 3, 2024
cff7820
chore: import "HTTPParser" from "node:_http_common"
kettanaito Mar 4, 2024
5d9a812
chore: abstract http message parser
kettanaito Mar 4, 2024
f7fded8
chore: introduce SocketWrap class
kettanaito Mar 5, 2024
4058080
test: add http compliance test suite
kettanaito Mar 5, 2024
1c74f23
fix: improve Socket compliance, add events tests
kettanaito Mar 5, 2024
a755028
test: migrate other http tests to socket interceptor
kettanaito Mar 5, 2024
095548c
feat(wip): agent-based socket interception
kettanaito Mar 9, 2024
d3df8e0
fix(MockHttpSocket): do not destroy the request stream
kettanaito Mar 9, 2024
cdf6c25
fix(MockHttpSocket): handle undefined writes on .end()
kettanaito Mar 9, 2024
3364c8e
feat: implement MockHttpsAgent
kettanaito Mar 9, 2024
7904858
fix: free the request parser on socket finish
kettanaito Mar 9, 2024
9c7794e
test: use new interceptor in response tests
kettanaito Mar 9, 2024
fa5827f
fix(MockHttpAgent): error with "Network error" on Response.error()
kettanaito Mar 9, 2024
48b3036
test: use the new interceptor in rest of response tests
kettanaito Mar 9, 2024
5d9d422
test: add all http tests
kettanaito Mar 9, 2024
00bb31a
chore: delete old "ClientRequestInterceptor"
kettanaito Mar 9, 2024
3c7b902
chore: add "_http_common.d.ts"
kettanaito Mar 10, 2024
aaa59b8
test: http-req-callback
kettanaito Mar 10, 2024
a81e947
fix(MockHttpAgent): support modifying request headers
kettanaito Mar 10, 2024
3dac2a0
test: fix invalid http-req-write callback tests
kettanaito Mar 10, 2024
bfa651b
test(http-request-without-options): remove non-mocked cases
kettanaito Mar 10, 2024
01ad60a
fix(MockHttpAgent): write headers for responses without body
kettanaito Mar 10, 2024
81f4cfc
fix(MockHttpSocket): preserve mocked response header name casing
kettanaito Mar 10, 2024
d41d16f
fix: implement the "response" event
kettanaito Mar 10, 2024
6e303ec
chore: remove logs
kettanaito Mar 10, 2024
6b4d06c
test(ClientRequest): adjust statusMessage assertion for inferred code
kettanaito Mar 10, 2024
640c9bf
fix(ClientRequest): restore https from https module
kettanaito Mar 10, 2024
dd53781
chore: remove unused "createRequest"
kettanaito Mar 10, 2024
4da4341
test: try fixing other tests
kettanaito Mar 10, 2024
635d12f
chore: use "NODE_TLS_REJECT_UNAUTHORIZED" flag for testing vs "httpsA…
kettanaito Mar 10, 2024
4972019
fix: update @types/node to support Readable.toWeb()
kettanaito Mar 10, 2024
46e51e4
test: fix "intecept/fetch" body assertions
kettanaito Mar 10, 2024
78d4ed3
fix: use "URL" from "node:url" and cast to string
kettanaito Mar 10, 2024
8fdb4b5
fix(MockHttpSocket): rely on "x-request-id" for event deduplication
kettanaito Mar 11, 2024
caeb168
chore: remove "SocketInterceptor"
kettanaito Mar 11, 2024
deff618
test: add mocked response body for HEAD request
kettanaito Mar 11, 2024
298d4ee
fix(MockHttpSocket): support empty ReadableStream in mocked responses
kettanaito Mar 11, 2024
13aea5b
fix(MockHttpSocket): emit correct events for TLS connections
kettanaito Mar 11, 2024
68ad529
chore: remove console.logs
kettanaito Mar 11, 2024
2cb79f3
test(MockSocket): add unit tests
kettanaito Mar 11, 2024
848ef00
docs: elaborate on when we free the parsers
kettanaito Mar 11, 2024
ac36cc6
docs: remove jest mention from the test
kettanaito Mar 11, 2024
81691ef
Merge branch 'main' into feat/yet-another-socket-interceptor
kettanaito Mar 21, 2024
700d34f
test: increase timeout for http-socket-timeout test
kettanaito Mar 21, 2024
230c238
chore: skip follow-redirect-http test
kettanaito Mar 21, 2024
2b1a5d7
fix: support Readable as request body (#527)
kettanaito Mar 21, 2024
3348dd7
fix(ClientRequest): spread object args to support "follow-redirects" …
kettanaito Mar 30, 2024
035bbe4
Merge branch 'main' into feat/yet-another-socket-interceptor
kettanaito Mar 31, 2024
92343e6
fix(MockHttpSocket): rely on internal request id header name
kettanaito Mar 31, 2024
69cffee
Merge branch 'main' into feat/yet-another-socket-interceptor
kettanaito Apr 12, 2024
824998b
fix(MockHttpSocket): exhaust .write() callbacks for mocked requests (…
kettanaito Apr 12, 2024
b49a316
Merge branch 'main' into feat/yet-another-socket-interceptor
kettanaito Apr 15, 2024
66c6046
fix: add "address()" on mock Socket (#549)
mikicho Apr 16, 2024
b170116
Merge branch 'main' into feat/yet-another-socket-interceptor
kettanaito Apr 16, 2024
6783a28
Merge branch 'main' into feat/yet-another-socket-interceptor
kettanaito Apr 17, 2024
ab8656e
docs: edit the algorithms section
kettanaito Apr 17, 2024
085d1ec
fix(MockHttpSocket): handle response stream errors (#548)
kettanaito Apr 17, 2024
430c65e
fix(MockHttpSocket): forward tls socket properties (#556)
kettanaito Apr 17, 2024
fc73636
chore: clean up ClientRequest utils (#557)
kettanaito Apr 18, 2024
e52851c
test: add `setTimeout` tests (#558)
kettanaito Apr 18, 2024
c362b39
test(MockHttpSocket): add "signal" tests (#559)
kettanaito Apr 18, 2024
8ff98db
fix(MockHttpSocket): set tls socket properties on init (#561)
mikicho Apr 21, 2024
f099479
Merge branch 'main' into feat/yet-another-socket-interceptor
kettanaito Apr 24, 2024
27ed6cd
merge main - resolve conflicts
mikicho Apr 28, 2024
5bbf61a
fix(ClientRequest): support "unhandledException" event
kettanaito Apr 29, 2024
b1481a3
fix: respect IPv6 hostnames and family (#571)
mikicho Apr 30, 2024
664a363
Merge branch 'main' into feat/yet-another-socket-interceptor
kettanaito Apr 30, 2024
7ab764e
test(http): add "connect" and "secureConnect" tests (#576)
kettanaito Jun 7, 2024
18ce9e4
Merge branch 'main' into feat/yet-another-socket-interceptor
kettanaito Jul 2, 2024
25b9c90
Merge branch 'main' into feat/yet-another-socket-interceptor
kettanaito Jul 3, 2024
028190b
chore: update @types/node to have Readable.toWeb()
kettanaito Jul 4, 2024
ab9c49a
fix: defer response end/close until response listeners are done
kettanaito Jul 4, 2024
e4f3377
Merge branch 'main' into feat/yet-another-socket-interceptor
kettanaito Jul 4, 2024
abdbd4d
Merge branch 'main' into feat/yet-another-socket-interceptor
kettanaito Jul 4, 2024
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
Prev Previous commit
Merge branch 'main' into feat/yet-another-socket-interceptor
kettanaito committed Jul 4, 2024
commit abdbd4d3108adfe48df90882441448d0b3d317ab

This merge commit was added into this branch cleanly.

There are no new changes to show, but you can still view the diff.