aboutsummaryrefslogtreecommitdiff
path: root/lib/http/testdata/server/range/fail_unit_test.txt
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2023-03-11 15:51:03 +0700
committerShulhan <ms@kilabit.info>2023-03-12 11:35:19 +0700
commit3c2f1c8044776eb68d9a1e2992eb37157b1018a6 (patch)
treed44ee3cc08de58c17529db45e773c6686606c094 /lib/http/testdata/server/range/fail_unit_test.txt
parent61786b2a6c1a7c9d11ee18cab4a804afdce9ffa5 (diff)
downloadpakakeh.go-3c2f1c8044776eb68d9a1e2992eb37157b1018a6.tar.xz
lib/http: add support for HTTP Range in Server
For HTTP Server using HandleFS, the Range request is handled automatically. For other HTTP server, user can use the HandleRange function. The HandleRange function handle [HTTP Range] request using "bytes" unit. The body parameter contains the content of resource being requested that accept Seek method. If the Request method is not GET, or no Range in header request it will return all the body [RFC7233 S-3.1]. The contentType is optional, if its empty, it will detected by http.ResponseWriter during Write. [HTTP Range]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Range_requests [RFC7233 S-3.1]: https://datatracker.ietf.org/doc/html/rfc7233#section-3.1 # Conflicts: # CHANGELOG.adoc
Diffstat (limited to 'lib/http/testdata/server/range/fail_unit_test.txt')
-rw-r--r--lib/http/testdata/server/range/fail_unit_test.txt13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/http/testdata/server/range/fail_unit_test.txt b/lib/http/testdata/server/range/fail_unit_test.txt
new file mode 100644
index 00000000..7ef5abe8
--- /dev/null
+++ b/lib/http/testdata/server/range/fail_unit_test.txt
@@ -0,0 +1,13 @@
+>>> header_range
+myunit=10-15
+
+<<< http_headers
+HTTP/1.1 406 Not Acceptable
+Content-Length: 0
+Content-Type: text/html; charset=utf-8
+
+<<< http_body
+
+<<< all_body
+
+<<< END