Commit Graph

545 Commits

Author SHA1 Message Date
Asher Gomez
899f000b85
chore(http): remove test files with symbols in the filename (#3879)
chore(http): remove test files w symbols in name
2023-11-30 10:50:07 +09:00
Asher Gomez
9ed93ade4f
docs(http): fix Status enum deprecation notice (#3851) 2023-11-24 08:21:18 +00:00
Asher Gomez
c89fb9b5aa
BREAKING(http): remove ServerSentEvent() (#3847) 2023-11-24 19:07:50 +11:00
Asher Gomez
9aa2909d06
BREAKING: deprecate std/http/method (#3834) 2023-11-22 18:40:07 +11:00
Asher Gomez
2f324fb1ce
BREAKING(http): deprecate enum Status in favour of STATUS_CODES object (#3781) 2023-11-17 13:26:11 +11:00
Lino Le Van
16db0d5e6f
BREAKING: move std/flags to new std/cli sub-module (#3530)
Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2023-11-16 11:08:51 +09:00
Asher Gomez
7d5344d775
docs: improve deprecation notices (#3804) 2023-11-16 05:33:11 +11:00
Yoshiya Hinosawa
38878eb779
test(http): fix op leak in file_server_test (#3806) 2023-11-15 17:37:19 +09:00
Asher Gomez
dec5a4a742
BREAKING: remove deprecated std/http/http_errors (#3737) 2023-11-15 05:12:48 +11:00
Asher Gomez
0dd0e3af47
BREAKING(http): deprecate ServerSentEvent() (#3783)
* BREAKING: deprecate `ServerSentEvent()`

* fix

* fix
2023-11-12 19:48:04 +11:00
Asher Gomez
56e2bc10e0
chore: use Array.fromAsync() where possible (#3788) 2023-11-11 06:00:28 +11:00
Asher Gomez
88477d1117
refactor: remove use of deferred() (#3786)
* refactor: remove use of `deferred()`

* fix

* fix
2023-11-10 14:31:16 +11:00
Asher Gomez
943f1a3088
fix: rework file server tests (#3779)
* fix: rework file server tests

* maybe fix

* maybe fix

* fix

* fix

* possible improvement

* possible improvement

* cleanup

* cleanups

* maybe fix

* fix

* fix

* fix

* fix

* fix
2023-11-09 11:01:46 +11:00
Asher Gomez
08f4dbc969
feat: ServerSentEventStream() (#3751) 2023-11-09 05:07:46 +11:00
Asher Gomez
b13a8cc7ac
chore(http): fix file server test names (#3772) 2023-11-08 14:31:52 +11:00
Asher Gomez
0beb3dbeea chore: use Deno.(read/write)TextFile() 2023-11-06 14:56:59 +11:00
Asher Gomez
9770bd2d4c
fix: add [Symbol.dispose]() to MockListener() (#3760)
fix: `MockListener()` dispose error
2023-11-02 00:29:36 +01:00
Asher Gomez
81dcc777a9
chore(http): remove http/unstable_errors (#3736)
BREAKING: deprecate `std/http/http_errors`
2023-11-01 19:57:50 +11:00
Lino Le Van
6f682c312f
chore(http): remove iterateReader() from file_server_test.ts (#3730)
* chore(http): remove iterateReader from file_server_test.ts

* chore: remove conn.close()

* chore: perhaps fix type error

* chore: fix lint errors

* chore: remove frankly silly type annotation

* passing-by tweak

---------

Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2023-10-28 11:34:08 +09:00
Asher Gomez
f64ea09b72
fix: flaky http/file_server.ts tests (#3717)
* fix: #3716

* additional fix

* revert

* fix

* fix

* rerun

* rerun

* rerun

---------

Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2023-10-26 12:17:57 +09:00
Lino Le Van
4890b472f4
fix(http): file server with showDirListing + urlRoot (#3691) 2023-10-23 15:04:58 +09:00
Asher Gomez
1f95611469
refactor: move unstable std/crypto files (#3699)
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2023-10-23 11:54:22 +09:00
Lino Le Van
65125db61f
BREAKING(http): move cookie_map, errors, server_sent_event, and method to unstable category, deprecate server.ts (#3661)
See https://github.com/denoland/deno_std/issues/3655 and https://github.com/denoland/deno_std/issues/3646 for details.

Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2023-10-13 16:24:58 +09:00
Sanjaiyan Parthipan
5b73e8b6d7
perf: improvements using Promise.all() (#3683)
Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2023-10-12 15:16:53 +09:00
Mark Gibson
b163c5604b
BREAKING(path): split path into per-os modules, deprecate legacy os-specific exports (#3649)
Deprecations:
- This change deprecates `win32` and `posix` exports from `path/mod.ts`,
- and also deprecates `path/win32.ts` and `path/posix.ts` paths.

New feature:
- This change adds `path/windows/mod.ts` and `path/posix/mod.ts` paths.

Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2023-09-28 19:54:53 +09:00
Tiger Oakes
52dfbebf59
refactor: avoid internally using strings for numbers (#3665) 2023-09-21 19:23:28 +09:00
Luca Casonato
de656e2b52
test: resource leaks caused by aggressive sanitizer (#3648) 2023-09-18 14:05:22 +02:00
David Luis
3c3916f1dc
refactor(http/cookie): remove dependency to std/datetime (#3632) 2023-09-12 20:37:57 +09:00
Yoshiya Hinosawa
9c5dc8925a
test(http): reduce http server test flakiness (#3612) 2023-09-07 21:16:17 +09:00
Yoshiya Hinosawa
911e110f97
test(http): reduce http test flakiness (#3590) 2023-09-01 16:40:35 +09:00
Yoshiya Hinosawa
6facda630a
refactor(_util): remove _util/os (#3564) 2023-08-25 18:07:43 +09:00
Lino Le Van
2b5d71224f
refactor: cleanup usage of double equals (#3566)
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2023-08-25 18:04:43 +09:00
ud2
159060b15c
perf: repoint internal imports to single-export files (#3537) 2023-08-14 16:08:42 +09:00
oli
c34d441374
fix(http/cookie_map): add maxAge to set/delete options (#3524) 2023-08-11 18:03:20 +09:00
Yoshiya Hinosawa
2fc511fc42
fix(http): fix handling of string port number (#3499) 2023-07-24 10:39:11 +09:00
Lino Le Van
1d489cf207
BREAKING(http/server): deprecate serve and serveTls (#3381) 2023-07-21 12:29:01 +09:00
Lino Le Van
e0753abe0c
refactor(http): simplify getSetCookies (#3491) 2023-07-18 10:29:27 +09:00
Asher Gomez
239e85ad6a
BREAKING(testing, assert): move std/testing/asserts to std/assert (#3445) 2023-07-13 16:04:30 +09:00
Yoshiya Hinosawa
2acd2bb2fc
chore: fix type errors caused by canary (#3477) 2023-07-04 13:57:05 +09:00
Kitson Kelly
7cdd55a083
feat: add http/user_agent (#3387) 2023-07-04 11:39:46 +09:00
Yoshiya Hinosawa
242746a479
test(http): re-enable 'serveDirIndex TLS' test on mac (#3471) 2023-06-29 14:05:58 +09:00
Martin Fischer
a5b1d80736
chore: fix typos (#3458)
The typos were found with the typos[1] spell checker.  That spell
checker will be incorporated into the CI in a followup PR.

[1]: https://github.com/crate-ci/typos
2023-06-22 01:27:37 +09:00
denobot
b7e6dc0914
0.192.0 (#3449)
Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-06-15 23:22:00 +02:00
Chocobo1
8bd34c3a45
fix(http/file_server): resolve empty subdir correctly on Windows (#3439) 2023-06-14 16:37:53 +09:00
Chocobo1
bdfacdd721
fix(http/file_server): use platform specific resolve (#3424) 2023-06-06 14:00:05 +09:00
David Luis
2d9dd290f0
BREAKING(csv,http,path): remove deprecated APIs (#3418) 2023-06-01 23:13:50 +09:00
Bartek Iwańczuk
63f57385b5
chore: remove ts-ignores (#3405) 2023-05-26 08:36:39 +03:00
denobot
bde4acaa29
0.189.0 (#3399)
Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-05-25 00:17:41 +02:00
Yoshiya Hinosawa
31c07ab89b
test(http): update cert error assertions (#3383) 2023-05-17 20:33:21 +09:00
ayame113
f7357c058c
fix(http/file_server): dealing with dir listing view that contain system files (#3371) 2023-05-10 15:15:03 +09:00
ayame113
28d2dd2698
docs(http/file_server): add module documentation (#3368) 2023-05-10 14:27:25 +09:00
Yoshiya Hinosawa
b781d630ec
refactor(http/file_server): use utils from std (#3366) 2023-05-07 15:48:39 +09:00
ayame113
c9af8416de
chore(http/file_server): remove unnecessary Date header generation (#3364) 2023-05-06 17:58:27 +09:00
ayame113
163a902a97
perf(http/file_server): read fileinfo in parallel (#3363) 2023-05-06 17:09:07 +09:00
ayame113
6e8ee3ceff
fix(http/file_server): redirect non-canonical URL to canonical URL (#3362) 2023-05-06 16:28:27 +09:00
David Luis
9c6532915a
fix(http/server_sent_event): fix Uncaught TypeError if created without optional EventInit (#3356) 2023-05-04 14:59:29 +09:00
ayame113
42a3a80ec4
fix(http/file_server): fix Range header handling (#3354) 2023-05-04 13:58:13 +09:00
Kitson Kelly
26cc265e26
feat(http): add HTTP_METHODS, HttpMethod, and isHttpMethod (#3309) 2023-05-03 17:38:24 +09:00
vwkd
1d0b8127a5
docs(http): add missing default values for ServeDir options of file_server (#3349) 2023-05-02 14:24:44 +09:00
tetraphobia
aa57bf337b
fix(http/server): flaky 'address in use' error (#3333) 2023-04-28 21:42:06 +09:00
ayame113
0f28d392e3
perf(http/file_server): avoid calculating Content-Type when 304 Not Modified response (#3323) 2023-04-19 15:42:33 +09:00
ayame113
30d18674ab
fix(http): move deno deploy specific logic from etag.ts to file_server.ts (#3316) 2023-04-18 17:07:28 +09:00
ayame113
f5ba1edf7d
fix(http/file_server.ts): respond to Range requests with correct byte length (#3319) 2023-04-18 16:34:51 +09:00
Yoshiya Hinosawa
a21550c844
docs(http): fix default etag algorithm (#3314) 2023-04-13 18:43:43 +09:00
Kitson Kelly
016b452409
feat: add http/etag (#3245) 2023-04-12 20:51:19 +09:00
Asher Gomez
cf14c9b212
chore(tools): improved web-compatibility checks (#3263) 2023-03-18 21:36:00 +09:00
Kitson Kelly
1c8cbbcab0
feat(http): add http/server_sent_event (#3239) 2023-03-14 15:29:44 +09:00
Tiago Gimenes
4b091f695d
fix(http/cookie): accept cookies with value containing = character (#3152) 2023-03-06 16:55:42 +09:00
Andreu Botella
da413bdac8
fix(http/file_server): redirect directory URLs that don't end with a slash (#3220) 2023-03-01 23:50:58 +09:00
ayame113
6bce2b49da
feat(http/file_server): etag value falls back to DENO_DEPLOYMENT_ID if fileInfo.mtime is not available (#3186) 2023-02-14 16:47:38 +09:00
Yoshiya Hinosawa
666f5dac0a
test(http): make file_server_test less flaky (#3183) 2023-02-13 13:26:27 +09:00
Roj
a506d22341
docs(http/file_server): headers are added to responses, not requests (#3139) 2023-01-29 15:41:28 +09:00
ayame113
b4239898d6
chore: update copyright header (#3082) 2023-01-03 19:47:44 +09:00
Asher Gomez
75bd5657d6
refactor(crypto): single-export files (#3065) 2022-12-28 17:42:55 +09:00
Lino Le Van
5bb2db62d6
feat(http): add --header option to file_server (#2977) 2022-12-27 13:43:04 +09:00
Yoshiya Hinosawa
c122c27edf
test(http): fix test case of http2 stream error (#3034) 2022-12-21 22:59:14 +09:00
Arnau Orriols
f7ed763119
fix(http): prevent downstream connections from getting closed when the response stream throws an error (#3008)
Co-authored-by: Luca Casonato <hello@lcas.dev>
2022-12-19 13:01:18 +01:00
Asher Gomez
c99bd33332
feat(datetime): single-export files (#3007) 2022-12-19 19:24:48 +09:00
Asher Gomez
fda52ca45b
feat(media_types): single-export files (#3001) 2022-12-19 19:02:14 +09:00
Yoshiya Hinosawa
01ec1428a7
chore: update Deno.Command usages (#2997) 2022-12-13 17:49:34 +09:00
Asher Gomez
c78061eef3
refactor: replace String.prototype.substr() with String.prototype.slice() (#2993) 2022-12-12 15:21:59 +09:00
Asher Gomez
6c2e01e6b8
refactor: replace use of Deno.spawnChild and Deno.run with Deno.Command (#2912)
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2022-11-30 14:12:34 +09:00
Asher Gomez
5dabeb2d91
refactor(streams): move to single-export files (#2957) 2022-11-29 08:55:38 -05:00
Aleksandr Hovhannisyan
f04499970b
docs(cookie): clarify properties and their usage (#2935) 2022-11-25 15:01:24 -05:00
Leo Kettmeir
aba5017d43
docs: reorganize docs (#2658) 2022-11-25 12:40:23 +01:00
Yoshiya Hinosawa
1d04b7dafd
feat(http/cookie): allow number type for expires param (#2932) 2022-11-24 01:43:35 +09:00
Simon Knott
bba790ecd4
fix(http/cookie): wording for cookie value validation error (#2931) 2022-11-23 22:45:33 +09:00
Asher Gomez
b72d3eb42a
refactor: replace Deno.spawn with Deno.Command (#2886) 2022-11-15 15:00:59 +09:00
木杉
cd108d5435
feat(http/file_server): add -v, --version option (#2868) 2022-11-11 14:08:35 +09:00
Asher Gomez
792f1334fe
refactor: use _util/asserts.ts for non-test code (#2857) 2022-11-10 16:28:20 +09:00
Asher Gomez
4de657fc5b
feat(crypto): createHash utility (#2805) 2022-10-25 15:48:13 -04:00
Asher Gomez
964ae5bcb6
refactor(http): use hashing functions from std/crypto (#2799) 2022-10-24 14:43:54 +09:00
Asher Gomez
e00830ae5f
chore(http/file_server): remove transform stream for partial content response (#2794)
remove: transform stream in partial response
2022-10-21 17:34:59 -04:00
Asher Gomez
c35b4fb4f8
refactor(http): createCommonResponse internal utility (#2773) 2022-10-14 18:32:29 +09:00
ayame113
6b04b730b1
chore: Avoid using rid-based filesystem functions (#2763) 2022-10-10 10:07:24 -04:00
Asher Gomez
059905852b
chore(http/file_server): simplify partial-content response stream (#2758)
simplify partial content response stream
2022-10-07 11:39:52 -04:00
Khaled Sakr
385511bc43
fix(http): remove unnecessary delay when closing server (#2732) 2022-10-04 11:22:56 -04:00
Yoshiya Hinosawa
a0a79f1e3f
refactor(http/file_server): simplify normalizeURL util (#2739) 2022-10-04 15:35:46 +09:00
Yoshiya Hinosawa
b161285109
feat(http/file_server): add showIndex option to serveDir (#2738) 2022-10-03 20:09:09 +09:00
Asher Gomez
4984358b15
chore(http): remove deprecated APIs (#2712) 2022-09-29 11:25:18 -04:00
Jeong, Heon
e3d8ceb6ee
fix(http/file_server): handles path with reserved char (#2675)
Current implementation don't escape some reserved characters, which
causing the browser to consider certain part is not the file path.
2022-09-29 11:02:43 -04:00
Asher Gomez
b555d43e6b
fix(http): serve swallows errors when Response.body has already been consumed (#2702) 2022-09-28 11:15:52 -04:00
Yoshiya Hinosawa
a08e42db01
fix(http/file_server): serveFile returns 404 when the path is directory (#2659) 2022-09-15 10:34:22 -04:00
Tim Reichen
2f7713a164
chore(tools): add deprecation check (#2613) 2022-09-15 16:06:04 +09:00
Asher Gomez
3b9fb39ddd
chore: remove void and Promise<void> return types (#2550) 2022-08-24 10:21:57 +09:00
Kitson Kelly
d3ee523011
feat(http): add CookieMap and SecureCookieMap (#2502) 2022-08-22 18:27:31 +10:00
Asher Gomez
237cc49f8b
feat(http/file_server): return 404 response if file not found (#2529) 2022-08-16 14:49:38 +09:00
Asher Gomez
822898d8b3
docs: removed types from jsdoc directives (#2515) 2022-08-13 23:53:23 +09:00
Asher Gomez
11819ce656
feat(http/cookie): add set-cookie headers parser (#2475) 2022-08-13 23:49:25 +09:00
JongChan Choi
f693ad60d4
feat(http): support cert, key options in serveTls (#2508) 2022-08-13 22:44:50 +09:00
Kitson Kelly
e83306672e
docs: improve module documentation (#2511) 2022-08-11 21:51:20 +10:00
Timo Rossa
c99fe6923b
feat(http/http_errors): add headers property (#2462)
Closes: #2451
2022-07-26 14:28:47 +10:00
Bartek Iwańczuk
c2a8951c04
chore: update to changes in spawn API (#2448) 2022-07-19 02:35:19 +02:00
Kitson Kelly
2a02009d42
feat(http): add content negotiation (#2302) 2022-07-04 17:26:56 +10:00
Kitson Kelly
5f0eb925d8
feat(http): add HTTP errors (#2307) 2022-07-04 16:40:11 +10:00
Timo Rossa
b5a32c6e44
fix(http): Disable console.error if opts.quiet is true (#2379)
Disable `console.error` if `opts.quiet` is true
2022-06-23 10:00:18 -04:00
Benjamin Fischer
45cf7717ec
feat(flags): infer argument types, names and defaults (#2180) 2022-06-21 15:36:51 +09:00
Sơn Trần-Nguyễn
c83dc62932
refactor(http/file_server): uniform status & statusText (#2361) 2022-06-17 12:26:44 +09:00
Sơn Trần-Nguyễn
c7484ff14b
docs(http/file_server): fix comment for mtime (#2350) 2022-06-16 15:21:32 +09:00
Bartek Iwańczuk
a06298b0b5
chore: Update top level module JSDocs (#2343)
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2022-06-14 11:20:56 +02:00
Benjamin Fischer
762c47a93c
BREAKING(flags): introduce negatable option (#2301) 2022-06-09 13:06:36 +09:00
Ruslan Tushov
bcc5747842
fix: pass resolved ephemeral port to onListen (#2311)
Pass resolved ephemeral port to onListen instead of 0.
2022-06-07 08:33:09 -04:00
Kitson Kelly
6df7747014
BREAKING feat(http): improve type safety and docs for http_status (#2297)
`STATUS_TEXT` is now just a record object instead of a map, which provides more utility for less overhead.
2022-06-03 11:21:43 +10:00
Kitson Kelly
71054ecf7f
refactor(http): file_server uses std/media_types (#2298) 2022-06-03 09:30:02 +10:00
ayame113
b3b6f944dd
chore(http/file_server): export interface for serveDir/serveFile (#2293)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-06-01 23:56:57 +09:00
Yoshiya Hinosawa
034c6e2833
test: fix unhandled promises in test cases (#2281) 2022-05-29 21:02:37 +09:00
Leo Kettmeir
852968f631
refactor: switch the Deno.spawn (#2161) 2022-05-25 11:08:27 +02:00
Yoshiya Hinosawa
d6bdd62390
feat(http/util): add compareEtag (#2259) 2022-05-23 13:53:16 +09:00
masx200
3403116ca9
fix(http/file_server): fix handling of 'W/' prefixed etag (#2229) 2022-05-16 22:24:11 +09:00
Yoshiya Hinosawa
629a458845
feat(http): add onListen option to serve (#2218) 2022-05-16 20:39:29 +09:00
like-nanhai
c75454c44b
docs: add module level docs (#2190) 2022-05-04 19:34:37 +09:00
Bartek Iwańczuk
d85a348f97
test(http): add catch handler to server promise (#2178) 2022-05-03 15:58:28 +02:00
Timo Rossa
0e74e21965
fix(http): export interface ServeTlsInit (#2148) 2022-04-24 21:20:56 +09:00
Ryan Dahl
3b7aca1842
http: serve() should log where it is listening (#1641)
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2022-04-22 16:15:44 -04:00
Divy Srivastava
ec966d3de6
chore(http): update file_server tests w.r.t. stream compression (#2133) 2022-04-21 18:29:34 +05:30
Jayden Seric
8c05217c5a
fix(http): use the addEventListener method instead of onabort properties (#2124) 2022-04-20 13:49:22 +09:00
Divy Srivastava
f62ef207f2
perf(http): optimize file server (#2116) 2022-04-18 08:11:11 +05:30
Yoshiya Hinosawa
b36f8a41b7
fix(node/http): ignore error from respondWith (#2058) 2022-03-24 01:19:00 +09:00
Jesse Jackson
58204e6f56
refactor: mark modules as browser compatible (#1972) 2022-03-01 13:25:50 +09:00
Yoshiya Hinosawa
936a8cf4d6
feat(http): expose serveDir function from file_server.ts (#1944) 2022-02-22 11:06:26 +09:00
Bartek Iwańczuk
658340bad4
fix: http/_mock_conn.ts (#1926) 2022-02-15 17:38:18 +01:00
Ryan Dahl
3b43d075ea
0.125.0
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-02-03 23:46:48 +01:00
Yoshiya Hinosawa
808fe203e0
chore: update copyright header (#1871) 2022-02-02 23:21:39 +09:00
Yoshiya Hinosawa
c331dad1df
chore: update mock Deno.Conn (#1867) 2022-02-01 18:28:05 +09:00
Luca Casonato
f0506f5d79
chore(http/file_server): only seek if necessary (#1836)
Minor peformance optimization.
2022-01-21 13:30:56 +01:00
Bartek Iwańczuk
f4e0d45590
chore: tweak server examples (#1822) 2022-01-13 18:33:00 +01:00
Bartek Iwańczuk
4d3094c935
feat(http): add eyecandy to file_server (#1804) 2022-01-09 02:51:55 +01:00
Erfan Safari
38b0a9f874
feat(http/file_server): add 'quiet' flag (#1773)
Fixes #1768.
2022-01-07 11:03:20 +01:00
Bartek Iwańczuk
efa94f2ccc
fix: http/bench.ts (#1776) 2022-01-02 12:02:20 +01:00
Jonas Grunert
251ad20639
BREAKING(http): remove Go-style address (#1660)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
Co-authored-by: Craig Morten <cmorten@users.noreply.github.com>
2021-12-14 00:38:32 +09:00