Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
2b51cd9
wip
cirospaciari May 6, 2025
1ee110a
better
cirospaciari May 6, 2025
2d5fde5
cleanuop
cirospaciari May 6, 2025
65544a1
opsie
cirospaciari May 6, 2025
2e105c7
more
cirospaciari May 6, 2025
0989896
keep same behavior
cirospaciari May 6, 2025
eab1d58
comments + trim space
cirospaciari May 6, 2025
4da3401
less spaces
cirospaciari May 6, 2025
38e7a3a
less spaces
cirospaciari May 6, 2025
1265e93
cleanner
cirospaciari May 6, 2025
3f11d04
more comments
cirospaciari May 6, 2025
d224ac8
cleanup getHeaders
cirospaciari May 6, 2025
de869ca
init ancientHttp
cirospaciari May 6, 2025
860e0ef
init ancientHttp
cirospaciari May 6, 2025
f54300b
more
cirospaciari May 7, 2025
3c53a70
validate chunk encoding
cirospaciari May 7, 2025
18a92cc
more
cirospaciari May 7, 2025
fce0113
opsie
cirospaciari May 7, 2025
0c7e305
more
cirospaciari May 8, 2025
f7322ca
more
cirospaciari May 8, 2025
748b586
more
cirospaciari May 8, 2025
712d078
we actually wanna to error in fragmented requests
cirospaciari May 8, 2025
f6d1f7f
nope
cirospaciari May 8, 2025
883de94
more
cirospaciari May 9, 2025
169ca85
more
cirospaciari May 9, 2025
616ec02
Merge branch 'main' into ciro/http-parser-refactor
cirospaciari May 9, 2025
f20fb28
trailer
cirospaciari May 9, 2025
da451fc
more
cirospaciari May 9, 2025
b16c9ff
more
cirospaciari May 9, 2025
cbbd400
more
cirospaciari May 9, 2025
6825539
Merge branch 'ciro/http-parser-refactor' into ciro/http-parser-errors
cirospaciari May 9, 2025
b68e640
fix smuggling
cirospaciari May 9, 2025
9b97702
Merge branch 'main' into ciro/http-parser-refactor
cirospaciari May 9, 2025
924f08e
Merge branch 'ciro/http-parser-refactor' into ciro/http-parser-errors
cirospaciari May 9, 2025
f568ad3
fix capture
cirospaciari May 9, 2025
96f9175
more
cirospaciari May 9, 2025
82ea308
not yet
cirospaciari May 9, 2025
a2ce153
Merge branch 'main' into ciro/http-parser-errors
cirospaciari May 9, 2025
742d3e3
`bun run prettier`
cirospaciari May 9, 2025
6f28f15
ok
cirospaciari May 9, 2025
f09d7bc
close
cirospaciari May 9, 2025
eeee03a
opsie
cirospaciari May 9, 2025
615facc
opsie
cirospaciari May 9, 2025
0d25a57
more
cirospaciari May 9, 2025
e5d7387
more
cirospaciari May 9, 2025
50a8e36
`bun run prettier`
cirospaciari May 9, 2025
ae691ec
asan fail
cirospaciari May 9, 2025
c3326d5
again
cirospaciari May 9, 2025
4621d79
one more
cirospaciari May 9, 2025
606954b
revert
cirospaciari May 9, 2025
6dd4dfd
one more hey
cirospaciari May 9, 2025
ac914fd
ok
cirospaciari May 9, 2025
93dbd3e
more tests
cirospaciari May 9, 2025
e1651c4
comment
cirospaciari May 9, 2025
33b2669
comments
cirospaciari May 9, 2025
5618727
maybe
cirospaciari May 9, 2025
17160fa
more
cirospaciari May 9, 2025
2a7d041
test
cirospaciari May 9, 2025
1464e2f
revert
cirospaciari May 9, 2025
2db7aa2
revert
cirospaciari May 9, 2025
56f0259
more test
cirospaciari May 9, 2025
1db3c56
`bun run prettier`
cirospaciari May 9, 2025
5804e28
ok
cirospaciari May 9, 2025
662de77
more test
cirospaciari May 9, 2025
3132e0b
ok
cirospaciari May 9, 2025
82ff7f0
better
cirospaciari May 9, 2025
35afa3f
more
cirospaciari May 9, 2025
f45fb12
wip
cirospaciari May 9, 2025
be735b8
wip
cirospaciari May 9, 2025
50c4dcb
throw
cirospaciari May 9, 2025
f5b7a5c
throw
cirospaciari May 9, 2025
8a52beb
Merge branch 'ciro/http-parser-errors' into ciro/http2-parser
cirospaciari May 9, 2025
69221f0
test
cirospaciari May 9, 2025
5be9ac0
revert this for now
cirospaciari May 9, 2025
7bfda9c
`bun run prettier`
cirospaciari May 9, 2025
745d9ed
Update packages/bun-uws/src/ChunkedEncoding.h
cirospaciari May 9, 2025
b17d954
Update packages/bun-uws/src/ChunkedEncoding.h
cirospaciari May 9, 2025
8867984
review
cirospaciari May 9, 2025
a49b51f
remove expectations
cirospaciari May 9, 2025
7a378fc
improve
cirospaciari May 9, 2025
49c8bb0
cleanup
cirospaciari May 9, 2025
8a66af2
await
cirospaciari May 9, 2025
90f3a67
Merge branch 'ciro/http-parser-errors' into ciro/http2-parser
cirospaciari May 9, 2025
927534b
more test fixes
cirospaciari May 9, 2025
c7eac69
Merge branch 'ciro/http-parser-errors' into ciro/http2-parser
cirospaciari May 9, 2025
d9268fe
remove test
cirospaciari May 9, 2025
0be47ce
Merge branch 'ciro/http-parser-errors' into ciro/http2-parser
cirospaciari May 9, 2025
2f46b3c
Merge branch 'main' into ciro/http2-parser
cirospaciari May 11, 2025
d7b1f97
more
cirospaciari May 11, 2025
559d72a
rstCode
cirospaciari May 11, 2025
ce56312
more
cirospaciari May 11, 2025
7f39a0d
capture rejections
cirospaciari May 11, 2025
3e0556e
more
cirospaciari May 11, 2025
4d32856
more
cirospaciari May 11, 2025
e33c01a
more
cirospaciari May 11, 2025
2635328
more
cirospaciari May 11, 2025
0e4318f
message back + remove flaky
cirospaciari May 11, 2025
fb8a17c
more tests
cirospaciari May 11, 2025
3ef7192
better
cirospaciari May 11, 2025
b74fd21
revert this
cirospaciari May 11, 2025
3fffa0a
again
cirospaciari May 11, 2025
3133f9d
typo
cirospaciari May 11, 2025
6c91f3e
test
cirospaciari May 11, 2025
6149f62
dup
cirospaciari May 11, 2025
0ff0617
remove flaky ones
cirospaciari May 11, 2025
825577e
more
cirospaciari May 11, 2025
6f4ee9f
more
cirospaciari May 11, 2025
83cff50
less
cirospaciari May 11, 2025
03cd9f2
deflaky windows
cirospaciari May 12, 2025
372d157
missing throw
cirospaciari May 12, 2025
dbceede
fixes from revie
cirospaciari May 12, 2025
67b122e
license
cirospaciari May 12, 2025
9d43769
assert instead of throw, this are already validated in TS side
cirospaciari May 12, 2025
4e11b9e
dont include destroy
cirospaciari May 12, 2025
571bd3c
clenaup
cirospaciari May 12, 2025
0cc27f7
more
cirospaciari May 12, 2025
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
14 changes: 11 additions & 3 deletions src/bun.js/api/bun/h2_frame_parser.zig
Original file line number Diff line number Diff line change
Expand Up @@ -3041,9 +3041,6 @@ pub const H2FrameParser = struct {
}

const error_code = error_arg.toU32();
if (error_code > 13) {
return globalObject.throw("Invalid ErrorCode", .{});
}

this.endStream(stream, @enumFromInt(error_code));

Expand Down Expand Up @@ -3472,6 +3469,16 @@ pub const H2FrameParser = struct {
return stream_id;
}

pub fn setNextStreamID(this: *H2FrameParser, _: *JSC.JSGlobalObject, callframe: *JSC.CallFrame) bun.JSError!JSValue {
JSC.markBinding(@src());
const args_list = callframe.arguments();
bun.debugAssert(args_list.len >= 1);
const stream_id_arg = args_list.ptr[0];
bun.debugAssert(stream_id_arg.isNumber());
this.lastStreamID = stream_id_arg.to(u32);
return .undefined;
}

pub fn hasNativeRead(this: *H2FrameParser, _: *JSC.JSGlobalObject, _: *JSC.CallFrame) bun.JSError!JSValue {
return JSC.JSValue.jsBoolean(this.native_socket == .tcp or this.native_socket == .tls);
}
Expand Down Expand Up @@ -3562,6 +3569,7 @@ pub const H2FrameParser = struct {
}
return .undefined;
}

pub fn emitErrorToAllStreams(this: *H2FrameParser, globalObject: *JSC.JSGlobalObject, callframe: *JSC.CallFrame) bun.JSError!JSC.JSValue {
JSC.markBinding(@src());

Expand Down
4 changes: 4 additions & 0 deletions src/bun.js/api/h2.classes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ export default [
fn: "hasNativeRead",
length: 1,
},
setNextStreamID: {
fn: "setNextStreamID",
length: 1,
},
getAllStreams: {
fn: "getAllStreams",
length: 0,
Expand Down
2 changes: 2 additions & 0 deletions src/bun.js/bindings/ErrorCode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ const errors: ErrorCodeMapping = [
["ERR_HTTP2_STREAM_ERROR", Error],
["ERR_HTTP2_TRAILERS_ALREADY_SENT", Error],
["ERR_HTTP2_TRAILERS_NOT_READY", Error],
["ERR_HTTP2_TOO_MANY_CUSTOM_SETTINGS", Error],
["ERR_HTTP2_UNSUPPORTED_PROTOCOL", Error],
["ERR_ILLEGAL_CONSTRUCTOR", TypeError],
["ERR_INCOMPATIBLE_OPTION_PAIR", TypeError],
["ERR_INVALID_ADDRESS", Error],
Expand Down
11 changes: 7 additions & 4 deletions src/bun.js/bindings/NodeValidator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -615,11 +615,14 @@ JSC_DEFINE_HOST_FUNCTION(jsFunction_validateBuffer, (JSC::JSGlobalObject * globa
auto buffer = callFrame->argument(0);
auto name = callFrame->argument(1);

if (!buffer.isCell()) return JSValue::encode(jsUndefined());
auto ty = buffer.asCell()->type();
if (!buffer.isUndefined()) {
if (!buffer.isCell()) return Bun::ERR::INVALID_ARG_TYPE(scope, globalObject, name, "Buffer, TypedArray, or DataView"_s, buffer);

if (JSC::typedArrayType(ty) == NotTypedArray) {
return Bun::ERR::INVALID_ARG_TYPE(scope, globalObject, name, "Buffer, TypedArray, or DataView"_s, buffer);
auto ty = buffer.asCell()->type();

if (JSC::typedArrayType(ty) == NotTypedArray) {
return Bun::ERR::INVALID_ARG_TYPE(scope, globalObject, name, "Buffer, TypedArray, or DataView"_s, buffer);
}
}
return JSValue::encode(jsUndefined());
}
Expand Down
Loading