aboutsummaryrefslogtreecommitdiff
path: root/test/js/web (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-10-09fix(AbortSignal/fetch) fix AbortSignal.timeout, fetch lock behavior and ↵Gravatar Ciro Spaciari 3-0/+181
fetch errors (#6390) * fix abort signal and fetch error * fix fetch error and lock behavior
2023-10-03fix(blob): Add the current offset to the new blob. (#6259)Gravatar Ai Hoshino 1-1/+28
Close: #6252
2023-10-03feat(encoding): support BOM detection with test passed (#6074)Gravatar WingLim 2-2/+24
2023-09-29Fix hang in `bun install` (#6192)Gravatar Jarred Sumner 1-0/+92
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-29fix: don't set default request method when creating a Request (#6154)Gravatar Liz 1-0/+10
In the case of creating a Request with the parameters `(Request, object)`, there was a bug that method and headers are set from the default created by the init rather then the already present value from the request param. This is because for a to me unknown reason the order in which the parameters are processed is reversed. This fixes that by adding a check which stops the defaults from being set, unless they are explicitly passed. Fixes: https://github.com/oven-sh/bun/issues/6144
2023-09-29Fixes #6053 (#6162)Gravatar Jarred Sumner 1-1/+3
Fixes #6053 Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-27fix: implement correct behaviour for urls with blob: scheme (#5825)Gravatar Liz 1-2/+4
* fix: implement correct behaviour for urls with blob: scheme Urls using the blob scheme can have special behaviour if their origin itself is a url. This fixes that by parsing the subdomain and if valid and the schemes(protocols) are valid returns its origin. Ive used node.js here a lot to make sure its behaviour is copied 1:1 and enabled the automated tests for it. Fixes https://github.com/oven-sh/bun/issues/5805 * fix: subUrl can be const, we are not modifying it * style: add spaces after `if` keyword
2023-09-26fix: support console.dir options object correctly (#6059)Gravatar Liz 2-0/+22
* fix: support console,dir options object correctly `console.dir` can be passed a second argument which is a object of options. This implements that logic with the currently supported properties: `depth` and `colors`. I used node as a reference for implementation details. Fixes: https://github.com/oven-sh/bun/issues/6039 * style: format zig file * fix: implement changes from review Implements changes requested from review, like adding more test cases and refactoring code style.
2023-09-26fix server end of stream, fix fetch not streaming without content-length or ↵Gravatar Ciro Spaciari 1-0/+29
chunked encoding, fix case when stream do not return a promise on pull (#6086)
2023-09-25Make error message for `new URL(invalid)` better (#6032)Gravatar Jarred Sumner 1-0/+13
* Make error message for `new URL(invalid)` better Thanks to @karlcow https://github.com/WebKit/WebKit/pull/13802 * redact --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-24Fixes #5985 (#5986)Gravatar Jarred Sumner 2-2/+41
* Fixes #5985 * Update confirm-fixture.js --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-21Revert "feat(encoding): support BOM detection (#5550)"Gravatar Jarred Sumner 1-23/+1
This reverts commit 5f66b4e729105286863a13955b1ed8897b45210e. This caused test failures in text-encoder. cc @WingLim
2023-09-21PrettierGravatar Jarred Sumner 1-11/+10
2023-09-20fix(console.log): change default depth from 8 to 2 (#5839)Gravatar Jibran Kalia 2-0/+21
This make it as the same default depth in Node. Source: https://github.com/nodejs/node/blob/480ab8c3a40451d5ea459dd35b4039679b26e195/doc/api/console.md?plain=1#L285
2023-09-20fix(fetch): fix redirect in relative path location. (#5781)Gravatar Ai Hoshino 1-0/+94
* fix(fetch): fix redirect in relative path location. * fix utf-8 encoding * use server.reload * check buf size * add RedirectURLTooLong test
2023-09-20feat(encoding): support BOM detection (#5550)Gravatar WingLim 1-1/+24
* fix(encoding): export `getIgnoreBOM` * feat(encoding): support ignoreBOM * fix(encoding): not replace BOM to 0xFFFD * chore: use strict equal
2023-09-19Align fetch() redirect behavior with spec (#5729)Gravatar Jarred Sumner 1-0/+121
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-18feat(console.log): Print annonymus when class name is unknown (#5595)Gravatar Jibran Kalia 1-1/+1
This matches the functionality in Node.
2023-09-17Workaround #5604 (#5615)Gravatar Jarred Sumner 1-0/+25
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-16feat(encoding): TextDecoder support undefined (#5387)Gravatar WingLim 1-0/+5
* feat(encoding): TextDecoder support undefined * chore: format test file
2023-09-16fix(fetch) handle 100 continue (#5496)Gravatar Ciro Spaciari 1-0/+60
* handle 100 continue * move comment * cleanup * fmt
2023-09-15fix(request) handle undefined/null/empty signal on request (#5503)Gravatar Ciro Spaciari 1-0/+37
* handle undefined/null/empty signal on request * better approach
2023-09-15feat(runtime): add `process.binding` `uv`/`natives`/`config` + make global ↵Gravatar dave caruso 1-0/+1
object properties lazy (#5355) * binding uv * we did that * some more bindings * fix doc * fix uv * yo * static hash table nonsense <3 * huge refactor to the global object i am not ready for merge conflicts * it works part 3 * lose --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-09-15Implement `URL.canParse` (#5463)Gravatar Jarred Sumner 1-0/+47
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-15Add missing `"size"` getter to `URLSearchParams` prototypeGravatar Jarred Sumner 1-0/+2
2023-09-13fix(node/fetch): Make data URL fetch consistent with node (#5126)Gravatar David Hewitt 1-0/+24
2023-09-11add NODE_TLS_REJECT_UNAUTHORIZED (#4829)Gravatar Ciro Spaciari 2-0/+32
2023-09-10Fixes #4588 (#4804)Gravatar Jarred Sumner 1-0/+7
* Fixes #4588 * typo * fixup --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-06feat(fetch) rejectUnauthorized and checkServerIdentity (#4514)Gravatar Ciro Spaciari 1-0/+151
* enable root certs on fetch * rebase * fix lookup * some fixes and improvements * fmt * more fixes * more fixes * check detached onHandshake * fix promise case * fix cert non-Native * add fetch tls tests * more one test
2023-09-05fix text decode trim (#4495)Gravatar Dylan Conway 1-0/+14
* remove trim * separate function * a test * trim when `stream` is true --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-09-05fix(fetch) always use readable stream if it is available (#4503)Gravatar Ciro Spaciari 1-0/+52
* always use readable stream if it is available * use bun sleep * fix tests * rm uws dep
2023-09-05fix ipv6 localhost fetch (#4498)Gravatar Dylan Conway 1-0/+20
* `node` null for localhost getaddrinfo * more test
2023-09-04fix zlib deflate on fetch (#4483)Gravatar Ciro Spaciari 1-2/+39
* fix zlib deflate on fetch * mention issue on test * more tests * oops
2023-08-31get name if not provided in `FormData.append` (#4434)Gravatar Dylan Conway 1-0/+30
* get file name from blob if not provided * add test * another test * format
2023-08-23Bunch of streams fixes (#4251)Gravatar Jarred Sumner 1-14/+17
* Update WebKit * Don't do async hooks things when async hooks are not enabled * Smarter scheduling of event loop tasks with the http server * less exciting approach * Bump WebKit * Another approach * Fix body-stream tests * Fixes #1886 * Fix UAF in fetch body streaming * Missing from commit * Fix leak * Fix the other leak * Fix test * Fix crash * missing duperef * Make this code clearer * Ignore empty chunks * Fixes #3969 * Delete flaky test * Update bun-linux-build.yml * Fix memory issue * fix result body, and .done status before the last callback, dont touch headers after sent once * refactor HTTPClientResult * less flasky corrupted test * oops * fix mutex invalid state * fix onProgressUpdate deinit/unlock * fix onProgressUpdate deinit/unlock * oops * remove verbose * fix posible null use * avoid http null * metadata can still be used onReject after toResponse * dont leak task.http * fix flask tests * less flask close tests --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Co-authored-by: cirospaciari <ciro.spaciari@gmail.com>
2023-08-21fetch(stream) add stream support for compressed and uncompressed data (#4127)Gravatar Ciro Spaciari 5-7/+1143
* 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-21Implement FileGravatar Jarred Sumner 2-1/+4
2023-08-12Fix worker event loop ref/unref + leak (#4114)Gravatar dave caruso 8-22/+77
* make more tests pass * worker changes * fix some bugs * remove this * progress * uh * okay * remove console log * a * comment assert for later * mergable state * remove test * remove test
2023-08-08worker tests (#4058)Gravatar dave caruso 2-1/+51
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-08-08Enable `Headers.prototype.getSetCookie`Gravatar Jarred Sumner 1-2/+1
Fixes #4057
2023-08-07Add `env` option for `node:worker_threads` (#4052)Gravatar dave caruso 4-1/+145
* almost works * env stuff * test fixes * wtfmove * ok * ok * ref by default * it now does the ref stuff by default * cool
2023-08-07implement fetching data urls (#4000)Gravatar Dylan Conway 1-0/+109
* 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-07fix iterating headers with `set-cookie` (#4048)Gravatar Dylan Conway 1-5/+13
* fix iterating headers with `set-cookie` * a test * move work to `HTTPHeaderMap::set` * append set-cookie after sort * remove compare function
2023-08-01close `BroadcastChannel` in testsGravatar Dylan Conway 2-1/+49
2023-08-01add `BroadcastChannel` (#3922)Gravatar Dylan Conway 3-14/+166
* copy and format * update `SerializedScriptValue.cpp` * use `expect().fail()` in message channel tests * rename `BroadcastChannelIdentifier.h` * copy registries * progress and tests * cleanup * worker and broadcast channel test * `BroadcastChannel` ref and unref * `MessagePort` ref, unref, and hasRef * remove `SecurityContext.cpp/h` * add types
2023-08-01Update worker.test.tsGravatar Dylan Conway 1-1/+1
2023-08-01Implement Worker.prototype.threadIdGravatar Jarred Sumner 1-0/+1
2023-07-31Add a test for TransformStreamGravatar Jarred Sumner 1-4/+43
2023-07-30Fix memory leak in response.clone(), further reduce memory usage of Request ↵Gravatar Jarred Sumner 2-6/+39
& Response (#3902) * Atomize respsone.url & response.statusText * Fix warning * Atomize Request & Response URLs when possible * Fix memory leak in response.clone() bun/bench/snippets on  jarred/atomize ❯ mem bun --smol request-response-clone.mjs cpu: Apple M1 Max runtime: bun 0.7.2 (arm64-darwin) benchmark time (avg) (min … max) p75 p99 p995 -------------------------------------------------------- ----------------------------- req.clone().url 77.3 ns/iter (40.35 ns … 222.64 ns) 91.53 ns 128.11 ns 172.78 ns resp.clone().url 162.43 ns/iter (116 ns … 337.77 ns) 177.4 ns 232.38 ns 262.65 ns Peak memory usage: 60 MB bun/bench/snippets on  jarred/atomize ❯ mem bun-0.7.1 --smol request-response-clone.mjs cpu: Apple M1 Max runtime: bun 0.7.1 (arm64-darwin) benchmark time (avg) (min … max) p75 p99 p995 -------------------------------------------------------- ----------------------------- req.clone().url 115.85 ns/iter (80.35 ns … 247.39 ns) 128.19 ns 181.93 ns 207.23 ns resp.clone().url 252.32 ns/iter (202.6 ns … 351.07 ns) 266.56 ns 325.88 ns 334.73 ns Peak memory usage: 1179 MB * Update tests * Update js_ast.zig * Update test --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-28fix types and add message channel/port gc testGravatar Dylan Conway 1-3/+15