aboutsummaryrefslogtreecommitdiff
path: root/src/http (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-09-17Fix assertion failure in debug buildsGravatar Jarred Sumner 1-1/+1
2023-08-29Rename `uws_event_loop` to `event_loop_handle`Gravatar Jarred Sumner 1-6/+6
2023-08-24wip (#4282)Gravatar Jarred Sumner 1-0/+4
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-21fetch(stream) add stream support for compressed and uncompressed data (#4127)Gravatar Ciro Spaciari 1-1/+0
* streams non compressed data in 64kb chunks (at least) * fmt * wip remove pause * fix default streaming and buffering * fix atomic lags * fix size * make chunked encoding work again (WIP streaming chunked) * WIP: chunked encoding streaming * fix end of streamings * working streaming + compression * add fixes + tests * fmt + fix proxy * fix oopsies * codegen after merge * fmt + fixes * more fixes * more fixes and logs * avoid double free * check empty before pop * check empty on pop * fix copy to real when complete * remove unnecessary logs * better has_schedule_callback swap, body locked size helper, remove isEmpty from unbounded_queue pop * fix response ref, fix body_size * add deflate support, fix error throw, add more tests * codegen after merge * remove logs, add connection close test * fix macOS build * fix redirect error option * make body_size more clear * support new Reponse(response) * toString DOMWrapper objects properly instead of supporting response in Response constructor * ignore headers with no name, add more tests * oops * handle transform with fetch * add gz image stream test * remove duplicate test * fix missing chunk on macOS under pressure * oops include all OS * some fixes * compare buffers instead of sizes * refactor err.err and protect it
2023-08-07implement fetching data urls (#4000)Gravatar Dylan Conway 1-9/+25
* fetch data urls * `byteSlice` * deinit slice * allocate `mime_type` string if needed * `content_type_allocated` and uncomment tests * `str_` * createAtom and slice decode result
2023-08-06Fixes #4010 (#4031)Gravatar Jarred Sumner 1-24/+17
* Fixes #4010 * Update websocket_http_client.zig --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-19Implement `AsyncLocalStorage` (#3089)Gravatar dave caruso 1-0/+1
* work to get async local storage working. * a * a * everything but queueMicrotask * sdfghj * . * finish * tests * test * ok * done * im so stupid * Upgrade WebKit * refactor * refactor * changes requested * oops * cool * fix runInAsyncScope
2023-07-18zig upgrade (#3667)Gravatar Dylan Conway 5-56/+56
* upgrade * more fixes * Bump Zig --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-13Implement `ping()`, `pong()`, `terminate()` for WebSocket client and server ↵Gravatar Ashcon Partovi 1-47/+78
(#3257)
2023-07-09fix metadata bits of uuid (`randomUUID()`) (#3583)Gravatar Ai Hoshino 1-1/+1
* fix uuid version Close: https://github.com/oven-sh/bun/issues/3575 * add unittest * small fix * avoid unnecessary copying
2023-07-07Add obscure HTTP methods (#3553)Gravatar Jarred Sumner 1-4/+84
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-05Update websocket_http_client.zigGravatar Dylan Conway 1-0/+2
2023-07-03Allow zero length WebSocket client & server messages (#3488)Gravatar Jarred Sumner 1-64/+108
* Allow zero length WebSocket client & server messages * Add test * Clean this up a little * Clean up these tests a little * Hopefully fix the test failure in release build * Don't copy into the receive buffer * Less flaky --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-25Reliability bugfix for `WebSocket` (#3394)Gravatar Jarred Sumner 1-3/+7
* Rewrite elementLengthLatin1IntoUTF8 * Update SIMDUTF * Make `elementLengthLatin1IntoUTF8` faster --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-21upgrade zig to `v0.11.0-dev.3737+9eb008717` (#3374)Gravatar Dylan Conway 2-17/+17
* progress * finish `@memset/@memcpy` update * Update build.zig * change `@enumToInt` to `@intFromEnum` and friends * update zig versions * it was 1 * add link to issue * add `compileError` reminder * fix merge * format * upgrade to llvm 16 * Revert "upgrade to llvm 16" This reverts commit cc930ceb1c5b4db9614a7638596948f704544ab8. --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com> Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-09`toMatchObject` and some asymmetric matchers (#3260)Gravatar Dylan Conway 1-0/+1
* `toMatchObject` progress * add `expect.stringContaining()` * add `expect.stringMatching()` * print asymmetric matchers * cleanup * return before printing if constructor value isn't there * move matcher logic to cpp * pretty format and tests * fix formatting for snapshots * format `stringContaining` and `stringMatching` like jest * better test * remove commented tests * remove old property matcher code * add types * make sure all props are matched in arrays * add `Bun.deepMatch`
2023-05-26Fix crash in test.todo + remove JSC C API usages in bun:test (#3079)Gravatar Jarred Sumner 1-9/+10
* Fix crash in test.todo * remove usages of JSC C API in bun:test * Remove additional JSC-C API usages * fix `make headers` * URLSearchParams.length * FormData length * URLSearchParams length * Fix `make headers` * very fancy length * Fix bug with exceptions being ignored sometimes * Add tests for extension toHaveLength --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-21[ws client] Make it a little more type safeGravatar Jarred Sumner 1-33/+51
2023-05-21fix(tls.connect) fix SNI on tls sockets and also servername (mongodb) (#2934)Gravatar Ciro Spaciari 1-0/+25
* fixes SNI on tls sockets and also servername * 💅 * 💅 * add support for https and wss * fix bun types * support Bun.file on ca, key and cert * 💅 * add setTimeout (makes fastify run) * fix httpVersion * fix WebSocketServer and add listen event * fix ws exports and http listening * fix default import * bump uws * add nodebuffer compatibility * fix drain and allow more passing tests to run * fix enqueud messages * default to arraybuffer * fix constructor binaryType * fmt * fixup * skip some tests * skip more * skip fault tests * reuse encoder instance * fix handshake WS Client * temporary revert handshake fix * fix handshake * disable all socket.io test temp * fixup * add back socket.io tests * use node_fs to read cert, ca and key on server.zig * throw the error returned by NodeFS * 💅
2023-04-19Fix broken autocompleteGravatar Jarred Sumner 7-11/+11
2023-03-17Fix various fetch/response/request tests (#2416)Gravatar Dylan Conway 1-0/+2
* fix most fetch tests, skip a few * fastGet, toValueGC, and invalid init * bigint unreachable, range error, log process as process * remove extra fetch_headers * remove js_type parameter, check isObject() * throw invalid mime type error, use enum literal * switch back to promise rejection * RangeError pascal case
2023-03-08More spec compliant `Blob.prototype.type` (#2340)Gravatar Jarred Sumner 1-0/+17
* 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-07improve `Buffer` compatibility with Node.js (#2341)Gravatar Alex Lam S.L 1-1/+1
* improve `Buffer` compatibility with Node.js * use `memmove()` allow `encoding` to be `undefined`
2023-02-24prefer `bun.copy()` over `std.mem.copy()` (#2152)Gravatar Alex Lam S.L 1-1/+1
2023-02-23Upgrade Zig (#2151)Gravatar Dylan Conway 2-4/+4
* fixup * Upgrade Zig * Remove bad assertion * strings * bump * mode -> optimize * optimize * Linux build * Update bindgen.zig
2023-02-13Fixes https://github.com/oven-sh/bun/issues/1456Gravatar Jarred Sumner 1-1/+1
2023-01-26fix large packages receive for WS client (#1909)Gravatar Ciro Spaciari 1-1/+1
2023-01-22fix unrefOnNextTickGravatar Jarred Sumner 1-3/+3
2023-01-10 use `strings.hasPrefixComptime()` (#1755)Gravatar Alex Lam S.L 1-2/+2
2023-01-03Remove usages of std.xGravatar Jarred Sumner 1-12/+6
2023-01-01Workaround https://github.com/ziglang/zig/issues/14148Gravatar Jarred Sumner 1-2/+3
2022-12-28[WebSocket] Implement `headers` supportGravatar Jarred Sumner 1-10/+52
Fixes https://github.com/oven-sh/bun/issues/1676
2022-12-28Upgrade to latest Zig (#1610)Gravatar Jarred Sumner 4-2297/+2300
* @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-01ComptimeStringMap is faster than ExactSizeMatcherGravatar Jarred Sumner 1-37/+22
2022-11-29import everything from "bun" where possibleGravatar Jarred Sumner 7-11/+11
2022-11-19[fetch] Fix sporadic data corruption bug in HTTP client and add fast pathGravatar Jarred Sumner 1-2/+10
- This removes memory pooling from the HTTP client which sometimes caused invalid memory to be written to the response body. - This adds a fast path for small HTTP/HTTPS responses that makes it a single memory allocation for the response body, instead of copying & allocating a temporary buffer cc @Electroid
2022-11-12Fix memory leak in gzip pool + add test for gzip'd dataGravatar Jarred SUmner 1-50/+11
2022-11-09FixupGravatar Jarred Sumner 1-12/+16
2022-11-09Re-enable workaround for 127.0.0.01Gravatar Jarred Sumner 1-2/+11
2022-10-25TCP & TLS Socket API (#1374)Gravatar Jarred Sumner 1-0/+2
* 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-17Handle assertion faillureGravatar Jarred Sumner 1-1/+3
2022-10-16Fix #1335Gravatar Jarred Sumner 1-9/+5
2022-10-15Simplify the code that reads HTTP client request bodiesGravatar Jarred Sumner 1-113/+0
2022-10-15add more loggingGravatar Jarred Sumner 1-9/+9
2022-10-15Fix bug where pong would put it in invalid stateGravatar Jarred Sumner 1-1/+1
2022-10-15Add some logging to WebSocket clientGravatar Jarred Sumner 1-0/+10
2022-10-08Fix https://github.com/oven-sh/bun/issues/1263Gravatar Jarred Sumner 3-1335/+15
What happened: when moving to uSockets for the http client, I forgot to call `SSL_set_tlsext_host_name` and uSockets apparently doesn't do that
2022-10-01Fix unref'ing websocketGravatar Jarred Sumner 1-2/+2
2022-09-28Clean up WebSocket never startingGravatar Jarred Sumner 1-10/+8
2022-09-17Update & configure SSL a littleGravatar Jarred Sumner 1-4/+4