Skip to content

Commit

Permalink
Merge branch 'main' into kai/dgram-reuseaddr
Browse files Browse the repository at this point in the history
  • Loading branch information
heimskr committed Jan 24, 2025
2 parents 81e8362 + 8f821b7 commit 74ecef8
Show file tree
Hide file tree
Showing 21 changed files with 1,240 additions and 499 deletions.
8 changes: 3 additions & 5 deletions packages/bun-lambda/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -364,17 +364,15 @@ function formatHttpEventV2(event: HttpEventV2): Request {
headers.append(name, value);
}
}
for (const [name, values] of Object.entries(event.queryStringParameters ?? {})) {
for (const value of values.split(",")) {
headers.append(name, value);
}
}
for (const cookie of event.cookies ?? []) {
headers.append("Set-Cookie", cookie);
}
const hostname = headers.get("Host") ?? request.domainName;
const proto = headers.get("X-Forwarded-Proto") ?? "http";
const url = new URL(request.http.path, `${proto}://${hostname}/`);
for (const [name, values] of Object.entries(event.queryStringParameters ?? {})) {
url.searchParams.append(name, values);
}
return new Request(url.toString(), {
method: request.http.method,
headers,
Expand Down
2 changes: 2 additions & 0 deletions src/bun.js/bindings/ErrorCode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1065,6 +1065,8 @@ JSC_DEFINE_HOST_FUNCTION(Bun::jsFunctionMakeErrorWithCode, (JSC::JSGlobalObject
return JSC::JSValue::encode(createError(globalObject, ErrorCode::ERR_STREAM_UNABLE_TO_PIPE, "Cannot pipe to a closed or destroyed stream"_s));
case ErrorCode::ERR_ILLEGAL_CONSTRUCTOR:
return JSC::JSValue::encode(createError(globalObject, ErrorCode::ERR_ILLEGAL_CONSTRUCTOR, "Illegal constructor"_s));
case ErrorCode::ERR_DIR_CLOSED:
return JSC::JSValue::encode(createError(globalObject, ErrorCode::ERR_DIR_CLOSED, "Directory handle was closed"_s));

default: {
break;
Expand Down
3 changes: 3 additions & 0 deletions src/bun.js/bindings/ErrorCode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ const errors: ErrorCodeMapping = [
// Console
["ERR_CONSOLE_WRITABLE_STREAM", TypeError, "TypeError"],

// FS
["ERR_DIR_CLOSED", Error],

// DNS
["ERR_DNS_SET_SERVERS_FAILED", Error],

Expand Down
Loading

0 comments on commit 74ecef8

Please sign in to comment.