summaryrefslogtreecommitdiff
path: root/std/http
AgeCommit message (Collapse)Author
2020-03-21BREAKING CHANGE Rename Deno.run's args to cmd (#4444)Akshat Agarwal
This is to avoid confusion with Deno.args which does not include the executable to be run.
2020-03-21avoid using same port number for test (#4147)Yusuke Sakurai
2020-03-20refactor(std/http/server): Remove bad error handling (#4435)Nayeem Rahman
2020-03-20Add require-await lint rule (#4401)Samrith Shankar
2020-03-20fix(std/http): Properly await ops in a server test (#4436)Nayeem Rahman
2020-03-19fix(std/http): Fix respond error test on Windows (#4408)Nayeem Rahman
2020-03-19std(http/server): close open connections on server close (#3679)Bartek Iwańczuk
Due to structure of "Server" for each open connection there's a pending "read" op. Because connection owned by "Server" are not tracked, calling "Server.close()" doesn't close open connections. This commit introduces simple tracking of connections for server and ensures owned connections are closed on "Server.close()".
2020-03-19refactor: rename Deno.TestDefinition.skip to ignore (#4400)Bartek Iwańczuk
2020-03-18feat: Deno.test() sanitizes ops and resources (#4399)Bartek Iwańczuk
This PR brings assertOps and assertResources sanitizers to Deno.test() API. assertOps checks that test doesn't leak async ops, ie. there are no unresolved promises originating from Deno APIs. Enabled by default, can be disabled using Deno.TestDefinition.disableOpSanitizer. assertResources checks that test doesn't leak resources, ie. all resources used in test are closed. For example; if a file is opened during a test case it must be explicitly closed before test case finishes. It's most useful for asynchronous generators. Enabled by default, can be disabled using Deno.TestDefinition.disableResourceSanitizer. We've used those sanitizers in internal runtime tests and it proved very useful in surfacing incorrect tests which resulted in interference between the tests. All tests have been sanitized. Closes #4208
2020-03-16refactor: add no-return-await lint rule (#4384)Bartek Iwańczuk
2020-03-15refactor(std): Uncomment disabled tests, use skip option (#4378)Nayeem Rahman
2020-03-14BREAKING CHANGE FileInfo.len renamed to FileName.size (#4338)dubiousjim
2020-03-14doc(http/server): Add coherence to the docs (#4372)Lucas De Angelis
Functions that returns a server are now documented with "Create", and functions that launches one are documented with "Start". Also added documentation for listenAndServe that respects these changes. Fixes #4367
2020-03-13fix(std): Use Deno.errors where possible. (#4356)Oliver Lenehan
2020-03-10refactor(cli/js/net): Cleanup iterable APIs (#4236)Nayeem Rahman
Listener and UDPConn are AsyncIterables instead of AsyncIterators. The [Symbol.asyncIterator]()s are defined as generators and the next() methods are gone. "Listener/Socket has been closed" errors are now BadResource.
2020-03-06Rename readDir -> readdir (#4225)dubiousjim
2020-02-27reduce unnecessary output on tests (#4148)Yusuke Sakurai
2020-02-26refactor(std/http): move io functions to http/io.ts (#4126)Yusuke Sakurai
2020-02-24fix: [http] Consume unread body and trailers before reading next request (#3990)Yusuke Sakurai
- Added `ServerRequest.finalize()`: consuming all unread body stream and trailers. - This is cleanup method for reading next request from same keep-alive connection. - Needed when handler didn't consume all body and trailers even after responding. - refactor: `ServerRequest._bodyStream()`, `ServerRequestBody` are removed. - Now using `bodyReader()` and `chunkedBodyReader()` instead. - fix: Trailers should only be read `transfer-encoding` is `chunked` and `trailer` header is set and its value is valid. - fix: use `Headers.append()` on reading trailers. - fix: delete `trailer` field from headers after reading trailers. - reorg: Several functions related to IO are moved into `http/io.ts`
2020-02-24rename Deno.Err -> Deno.errors (#4093)Bartek Iwańczuk
2020-02-23fix: [ws] sock shouldn't throw eof error when failed to read frame (#4083)Yusuke Sakurai
2020-02-21refactor: remove unneeded ErrorKinds (#3936)Bartek Iwańczuk
2020-02-19Enable TS strict mode by default (#3899)Maximilien Mellen
Fixes #3324 Co-authored-by: Kitson Kelly <me@kitsonkelly.com>
2020-02-13fix: appended CRLF to end of trailer headers (#3989)Yusuke Sakurai
2020-02-11fix(file_server): don't crash on "%" pathname (#3953)木杉
2020-02-11refactor: rewrite tests in std/ to use Deno.test (#3930)Bartek Iwańczuk
2020-02-10feat: Support HTTP trailer headers for response (#3938)Yusuke Sakurai
2020-02-08reenable server tests (#3928)Bartek Iwańczuk
2020-02-08remove non-null assertion operator from std (part2) (#3927)Yusuke Sakurai
2020-02-07remove non-null assertion operator from std (part1) (#3900)Yusuke Sakurai
2020-02-04std/http/server::serve aligned to std/http/server::serveTLS (#3881)Kitson Kelly
2020-01-31chore: remove std/installer, port installer tests to Rust (#3843)Bartek Iwańczuk
2020-01-30feat: deno install in Rust (#3806)Bartek Iwańczuk
//std/installer couldn't be removed due to bug, but it's now deprecated.
2020-01-27dx: descriptive permission errors (#3808)Bartek Iwańczuk
Before: ``` ▶ target/debug/deno https://deno.land/std/examples/echo_server.ts error: Uncaught PermissionDenied: run again with the --allow-net flag ► $deno$/dispatch_json.ts:40:11 at DenoError ($deno$/errors.ts:20:5) at unwrapResponse ($deno$/dispatch_json.ts:40:11) at sendSync ($deno$/dispatch_json.ts:67:10) at listen ($deno$/net.ts:170:15) at https://deno.land/std/examples/echo_server.ts:4:23 ``` ``` ▶ target/debug/deno --allow-read=/usr https://deno.land/std/examples/cat.ts /etc/passwd error: Uncaught PermissionDenied: run again with the --allow-read flag ► $deno$/dispatch_json.ts:40:11 at DenoError ($deno$/errors.ts:20:5) at unwrapResponse ($deno$/dispatch_json.ts:40:11) at sendAsync ($deno$/dispatch_json.ts:91:10) ``` After: ``` ▶ target/debug/deno https://deno.land/std/examples/echo_server.ts error: Uncaught PermissionDenied: network access to "0.0.0.0:8080", run again with the --allow-net flag ► $deno$/dispatch_json.ts:40:11 at DenoError ($deno$/errors.ts:20:5) at unwrapResponse ($deno$/dispatch_json.ts:40:11) at sendSync ($deno$/dispatch_json.ts:67:10) at listen ($deno$/net.ts:170:15) at https://deno.land/std/examples/echo_server.ts:4:23 ``` ``` ▶ target/debug/deno --allow-read=/usr https://deno.land/std/examples/cat.ts /etc/passwd error: Uncaught PermissionDenied: read access to "/etc/passwd", run again with the --allow-read flag ► $deno$/dispatch_json.ts:40:11 at DenoError ($deno$/errors.ts:20:5) at unwrapResponse ($deno$/dispatch_json.ts:40:11) at sendAsync ($deno$/dispatch_json.ts:91:10) ```
2020-01-24fix(std/http): update listenAndServe argument type (#3775)Carl Rosell
allow same argument type for `listenAndServe` as `serve`. fixes: #3774
2020-01-21change copyrights from 2019 to 2020 (#3733)Takashi Idobe
2020-01-18stabilize net Addr (#3709)Bartek Iwańczuk
Co-authored-by: xiaoxintang <15707971810@163.com>
2020-01-18rename dial to connect and dialTLS to connectTLS (#3710)Bartek Iwańczuk
2020-01-17std/http: allow response body to be string (#3705)Kevin (Kun) "Kassimo" Qian
2020-01-15Revert "feat(flags): script arguments come after '--'" (#3681)Ry Dahl
Due to complaints about ergonomics and because it breaks shebang on linux. This reverts commit 2d5457df15d8c4a81362bb2d185b5c6013faa1d8. BREAKING CHANGE
2020-01-09feat: Deno.args now does not include script (#3628)Ry Dahl
Previously Deno.args was ["script.js", "arg1", "arg2"] Now it is just ["arg1", "arg2"] BREAKING CHANGE
2020-01-08feat(flags): script arguments come after '--' (#3621)Ry Dahl
2020-01-02Happy new year! (#3578)Ry Dahl
2020-01-02feat(std/http): make req.body a Reader (#3575)Kevin (Kun) "Kassimo" Qian
2019-12-20feat: Add missing mod.ts files in std (#3509)Nayeem Rahman
std/archive/tar.ts: - Remove FileReader. - Remove FileWriter. std/encoding/csv.ts: - ExtendedParseOptions -> ParseOptions - HeaderOption -> HeaderOptions - ParseOptions -> ReadOptions - readAll() -> readMatrix() std/encoding/yaml.ts: - DumpOptions -> StringifyOptions std/fmt/colors.ts: - getEnabled() -> getColorEnabled() - setEnabled() -> setColorEnabled() std/testing/mod.ts: - Re-export sibling modules.
2019-12-14Support utf8 in file_server (#3495)木杉
2019-12-14feat(file_server): add help & switch to flags (#3489)木杉
2019-12-12file_server: get file and fileInfo concurrently (#3486)Weijia Wang
2019-12-12fix: file_server swallowing permission errors (#3467)木杉
2019-12-12benchmark: align deno_http and node_http response (#3484)Kevin (Kun) "Kassimo" Qian