aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/bindings/headers-cpp.h (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-09-04fix(HTMLRewriter) buffer response before transform (#4418)Gravatar Ciro Spaciari 1-0/+8
* html rewriter response buffering * pipe the data when marked as used * fix empty response * add some fetch tests * deinit parent stream * fix decompression * keep byte_reader alive * update builds * remove nonsense * was not nonsense after all * protect tmp ret value from GC, fix readable strong ref deinit/init * fmt * if we detach the stream we cannot update the fetch stream * detach checking source * more tests, progress with javascript and Direct sink * drop support for pure readable stream for now * more fixes --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-08-18Fix `make headers`Gravatar Jarred Sumner 1-3/+3
2023-05-17Finish bumpingjarred/webkit-upgrade-may-17Gravatar Jarred Sumner 1-1/+7
2023-05-09Expose bindings for `Map`Gravatar Jarred Sumner 1-4/+12
2023-04-14Upgrade Zig (#2656)Gravatar Jarred Sumner 1-1/+1
* Upgrade Zig * Don't add `d` files in github actions * Revert "Don't add `d` files in github actions" This reverts commit 446e2dd6743da08ec4136233fdc9179dbbf58fca. --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-04-13Upgrade WebKit (#2643)Gravatar Jarred Sumner 1-1/+1
* Missing export * Regenerate builtins * Fix crash in require() * Various breaking JSC changes * hopefully speed up C++ compilation a little * Skip failing test fo rnow * Update WebKit * Add a comment * Fix error in postinstall * Update WebKit --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-03-19Several bug fixes (#2427)Gravatar Jarred Sumner 1-1/+1
* Fix test * Fix segfault when unexpected type is passed in `expect().toThrow` * Fix issues with request constructor * Don't bother cloning headers when its empty * woops * more tests * fix incorrect test * Make the fetch error messages better * Update response.zig * Fix test that failed on macOS * Fix test * Remove extra hash table lookups * Support running dummy registry directly cc @alexlamsl * Update test * Update test * fixup * Workaround crash in test runner * Fixup test * Fixup test * Update os.test.js --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-03-17Feat(test): add toMatch (#2404)Gravatar zhiyuan 1-1/+1
2023-03-15feat(expect): update toBeInstanceOf (#2396)Gravatar zhiyuan 1-1/+1
* feat: update instanceof binding * fix: according to PR comments
2023-03-08More spec compliant `Blob.prototype.type` (#2340)Gravatar Jarred Sumner 1-1/+1
* Make `Blob.prototype. type` more spec compliant * Add a few more checks for isNumber() * Fix `make headers` * Safer JSValue.isString() * More tests for blob.slice * Make `Blob.prototype.type` more spec compliant * Add isASCII check * Fix types * Fix failing type test * Update blob.zig * Update blob.zig * Fix .eql check on empty values --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-03-02put AbortSignal in WebCore namespace (#2267)Gravatar Ciro Spaciari 1-9/+9
2023-02-23Upgrade Zig (#2151)Gravatar Dylan Conway 1-1/+1
* fixup * Upgrade Zig * Remove bad assertion * strings * bump * mode -> optimize * optimize * Linux build * Update bindgen.zig
2023-02-22feat(Request.signal) Initial support for signal in Request + fetch and ↵Gravatar Ciro Spaciari 1-1/+1
Request + Bun.serve (#2097) * add fetch abort signal * get aborted (still segfaults) * bidings.zig u0 error * still GC/memory error * fix start crash * fix AbortSignal fromJS * change fromJS to obj.as * addAbortSignalEventListenner * handle abort types, and add tests * fix tests * add custom reason test * merge 2 substring methods, use MAKE_STATIC_STRING_IMPL * fix create AbortError and TimeoutError, move globalThis and exception creation to main thread * fix tests and rebuild headers * no need to check with substring reason is already an exception * no need to check with substring reason is already an exception * fix dumb error inverting conditions for check reason * fix custom reason behavior * Request signal * remove package-lock.json * Remove JSC.Strong from Request signal * fix globals for fetch abort signal * more tests, clone signal crashs * fix AbortSignal.toJS * fix toJS bidings for AbortSignal * add streaming tests * fix abortion before connecting * fix tests and segfault * add fetch testing abort after finish * fix signal handler cleanup * support signal event Bun.serve * pull tests (failing) * remove unsupported test * formating * fix server Request.signal, fix cleanNativeBindings * add direct tests * more pull tests * fix stream tests * fix fetch, pending onAborted fix in HTTPServerWritable --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-02-22[breaking] Return Node.js `Timeout` objects in `setTimeout`, `setInterval`, ↵Gravatar Jarred Sumner 1-1/+1
and `setImmediate` Fixes #2129 #880
2023-02-17Fix #1602 (#2066)Gravatar Justin Whear 1-1/+1
* initial test case * fix segfault from JSObjectMakeDeferredPromise * pass exceptions through from FetchHeader.createFromJS * not resolved, but getting close * implement review suggestions * fix exception check, tests * Change how header filtering is accomplished Previously the FetchHeaders implementation relied on converting names and values to IDLByteString to catch non-ASCII data, though not always reliably. This resulted in message-less TypeErrors when headers contained invalid characters. This commit shifts everything to IDLDOMString for the conversion and relies on the actual error checking in FetchHeaders.canWriteHeader, resulting in nicer error messages. To ensure that all headers are written as ASCII/UTF8 rather than UTF16, the copyTo bindings function checks the encoding and converts if necessary. * wrapping up FetchHeader fixes * since utf8 allocates only do so when needed * Update src/bun.js/bindings/bindings.cpp Co-authored-by: Jarred Sumner <jarred@jarredsumner.com> * WebCore__FetchHeaders__has should return on exception path * strip out log calls from test --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-02-15feat(fetch) AbortSignal (#2019)Gravatar Ciro Spaciari 1-4/+12
* add fetch abort signal * get aborted (still segfaults) * bidings.zig u0 error * still GC/memory error * fix start crash * fix AbortSignal fromJS * change fromJS to obj.as * addAbortSignalEventListenner * handle abort types, and add tests * fix tests * add custom reason test * merge 2 substring methods, use MAKE_STATIC_STRING_IMPL * fix create AbortError and TimeoutError, move globalThis and exception creation to main thread * fix tests and rebuild headers * no need to check with substring reason is already an exception * no need to check with substring reason is already an exception * fix dumb error inverting conditions for check reason * fix custom reason behavior
2023-02-13Implement `FormData` (#2051)Gravatar Jarred Sumner 1-4/+12
* Backport std::forward change * Implement `FormData` * Fix io_darwin headers issue * Implement `Blob` support in FormData * Add test for file upload * Fix bug with Blob not reading Content-Type * Finish implementing FormData * Add FormData to types --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-01-24Fixes #1887Gravatar Jarred Sumner 1-1/+1
2023-01-21Implement `process.execArgv`Gravatar Jarred Sumner 1-1/+1
2023-01-21Support query string parameters in module resolutionGravatar Jarred Sumner 1-1/+1
2023-01-11`require.resolve` in the runtime should use CommonJS export conditionsGravatar Jarred Sumner 1-1/+1
2023-01-10attempt (unsuccessfully) to improve c++ build timeGravatar Jarred Sumner 1-1/+1
2023-01-08[internal] Fix checking for Error objectGravatar Jarred Sumner 1-1/+1
2023-01-07[Bun.connect] Fix bug where connect() Promise wouldn't reject on a ↵Gravatar Jarred Sumner 1-1/+1
connection error
2023-01-07Implement DNS module (#1691)Gravatar Jarred Sumner 1-1/+1
* Boilerplate for DNS stuff * Add c-ares * lookup * make * Implement dns.lookup * Create c-ares * wip * normalize * repro * Revert "repro" This reverts commit 8b93e0c295b335b8882a9601da47720348549beb. * Implement macOS `getaddrinfo_async_start` * embiggen * Update string_immutable.zig * Update Makefile * alright * Update .gitignore * Add types * more ccache * Update Dockerfile * Update Dockerfile * Update Dockerfile * Update bun.d.ts Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-01-01[internal] Add more bindingsGravatar Jarred Sumner 1-1/+1
2022-12-30Upgrade WebKitGravatar Jarred Sumner 1-1/+1
2022-12-28[WebSocket] Implement `headers` supportGravatar Jarred Sumner 1-1/+1
Fixes https://github.com/oven-sh/bun/issues/1676
2022-12-28Move some code upGravatar Jarred Sumner 1-1/+1
2022-12-28Upgrade to latest Zig (#1610)Gravatar Jarred Sumner 1-1/+1
* @min and @max * builtins and some trivial ones * Most of them * more * more! * More Progress * wip * Update tagged_pointer.zig * Update http_client_async.zig * Most of the iterable dir changes * alright * Remove usages of deprecated formatters * :camera: * fmt * Update shimmer.zig * wip * wip * wip * progress * more * Latest * stuck on error * latest * workaround stage2 * wip * Update string_immutable.zig * wip * Migrate `Dirent` and `require("fs')` to use JSC<>Zig bindings * Fix build errors * Fixup most of the test failures * Fix `make headers` * Fix "outside package path" error * Fixup aligned alloc * Add missing file * linux * More linux fixes * use latest peechy * Fix transpiler test failure * Forgot about these * Fixup test failure * Update node-timers.test.ts * [node:htt] Fix `undefined is not an object` error Fixes https://github.com/oven-sh/bun/issues/1618 * Update http.exports.js * Make this test less flaky * fix hashes * Fix hex formatting and zls issues * Download zig version * Update Dockerfile * Update Dockerfile * Update uws * Update Dockerfile * Set llvm version * Update README.md * Update uws * Update Dockerfile * Update io_linux.zig * Update bun.zig * Log output * workaround strange @cInclude error * Make ffi tests better * Don't use cImport * Update c.zig * Update c-bindings.cpp * call setOutputDir * Update Dockerfile * Use a longer name * latest * Update serve.test.ts Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Co-authored-by: Veikka Tuominen <git@vexu.eu>
2022-12-20[web] Support multiple arguments in `setTimeout`, `setInterval`, and ↵Gravatar Jarred Sumner 1-1/+1
`setImmediate`
2022-12-17Delete Oniguruma (#1625)Gravatar Jarred Sumner 1-1/+1
* Update .gitmodules * Delete oniguruma * Delete Oniguruma * Make this test less flaky * :scissors: Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2022-12-15[node:process] Implement `process.argv0`, `process.execPath`Gravatar Jarred Sumner 1-4/+4
Fixes https://github.com/oven-sh/bun/issues/1599
2022-12-11Update WebKitGravatar Jarred Sumner 1-1/+1
cc @cirospaciari you will need to re-download the precompiled WebKit build from the releases page https://github.com/oven-sh/WebKit/releases/tag/dec11 because there is one small WebKit API change. LMK if you have any trouble with that
2022-12-05Make `console` an `AsyncIterable`Gravatar Jarred Sumner 1-1/+1
2022-12-01Reduce memory usage in Bun.serve() by up to 3x (#1569)Gravatar Jarred Sumner 1-1/+1
* Update WebKit * Use 5x less memory in Bun.serve() * Update Dockerfile.devcontainer * Update async-overhead.mjs Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2022-11-29Remove some dead bindings codeGravatar Jarred Sumner 1-92/+4
2022-11-29import everything from "bun" where possibleGravatar Jarred Sumner 1-1/+1
2022-11-27[console.log] Fix printing latin1 supplement characters at runtimeGravatar Jarred Sumner 1-1/+1
Fixes https://github.com/oven-sh/bun/issues/1031#issuecomment-1236092120
2022-11-25Upgrade WebKitGravatar Jarred Sumner 1-1/+1
2022-11-23possibly more reliable Bun.spawn (#1547)Gravatar Jarred Sumner 1-1/+1
* wip * wip * Fix bug with stdin * zig fmt * seems to work! * Update streams.test.js Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2022-11-20Fix spurious rejected promise handler callsGravatar Jarred Sumner 1-1/+1
2022-11-06Add way to explicitly coercion object to int32Gravatar Jarred Sumner 1-1/+1
2022-10-28Upgrade WebKitGravatar Jarred Sumner 1-1/+1
2022-10-25TCP & TLS Socket API (#1374)Gravatar Jarred Sumner 1-1/+1
* TCP Socket API * Wip * Add snippet for StringDecoder * Rename `close` to `stop`, replace `close` with `end` * Add a tcp echo server test * Some docs * Update README.md * Fix build * Update README.md Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2022-10-20Fix Bun.serve error handler error param (#1359)Gravatar zhiyuan 1-1/+1
2022-10-17add oniguruma for regex with variable length lookbehinds (#1329)Gravatar Dylan Conway 1-1/+1
* added pcre2 submodule * pcre2 regex boilerplate * tests for pcre2 regex * flag validation, getters, construct and compile mostly working * string escaping for source and toString(), exec, more tests * flag sorting, match, matchAll, search, split, replace * remove lib link * add destructor to PCRE2RegExp * header include * removed ternary * switched to oniguruma for regex library * revert sql changes * fix indices flag, add tests * revert settings * working error messages * more tests for lastIndex, fix logic for compile and lastIndex * move oniguruma lib to deps out dir
2022-10-17Implement `sendText`, `sendBinary`, `publishText`, `publishBinary`Gravatar Jarred Sumner 1-1/+1
2022-10-15WebSocket Server supportGravatar Jarred Sumner 1-1/+1
2022-10-09Update WebKitGravatar Jarred Sumner 1-1/+1