aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorjdamanalo <[email protected]>2023-03-31 15:56:23 +0800
committerLoïc Hoguin <[email protected]>2023-12-21 15:39:08 +0100
commit3ed1b24dd6ef6cd3e78a2fa6d600cce082b6984a (patch)
tree741d1845f7c3b04c198ac2476abf34aa4757d6ba /doc
parentffbcdf534c7bdcca545e245443cc48056bcd6944 (diff)
downloadcowboy-3ed1b24dd6ef6cd3e78a2fa6d600cce082b6984a.tar.gz
cowboy-3ed1b24dd6ef6cd3e78a2fa6d600cce082b6984a.tar.bz2
cowboy-3ed1b24dd6ef6cd3e78a2fa6d600cce082b6984a.zip
Add cowboy_decompress_h stream handler
Diffstat (limited to 'doc')
-rw-r--r--doc/src/guide/streams.asciidoc5
-rw-r--r--doc/src/manual/cowboy_compress_h.asciidoc1
-rw-r--r--doc/src/manual/cowboy_decompress_h.asciidoc58
-rw-r--r--doc/src/manual/cowboy_metrics_h.asciidoc1
-rw-r--r--doc/src/manual/cowboy_stream_h.asciidoc1
-rw-r--r--doc/src/manual/cowboy_tracer_h.asciidoc1
6 files changed, 67 insertions, 0 deletions
diff --git a/doc/src/guide/streams.asciidoc b/doc/src/guide/streams.asciidoc
index 0ac84ce..b6e4d34 100644
--- a/doc/src/guide/streams.asciidoc
+++ b/doc/src/guide/streams.asciidoc
@@ -65,6 +65,11 @@ automatically compress responses when possible. It is not
enabled by default. It is a good example for writing your
own handlers that will modify responses.
+link:man:cowboy_decompress_h(3)[cowboy_decompress_h] will
+automatically decompress requests when possible. It is not
+enabled by default. It is a good example for writing your
+own handlers that will modify requests.
+
link:man:cowboy_metrics_h(3)[cowboy_metrics_h] gathers
metrics about a stream then passes them to a configurable
function. It is not enabled by default.
diff --git a/doc/src/manual/cowboy_compress_h.asciidoc b/doc/src/manual/cowboy_compress_h.asciidoc
index 31a9162..f6a45a9 100644
--- a/doc/src/manual/cowboy_compress_h.asciidoc
+++ b/doc/src/manual/cowboy_compress_h.asciidoc
@@ -63,6 +63,7 @@ The compress stream handler does not produce any event.
link:man:cowboy(7)[cowboy(7)],
link:man:cowboy_stream(3)[cowboy_stream(3)],
+link:man:cowboy_decompress_h(3)[cowboy_decompress_h(3)],
link:man:cowboy_metrics_h(3)[cowboy_metrics_h(3)],
link:man:cowboy_stream_h(3)[cowboy_stream_h(3)],
link:man:cowboy_tracer_h(3)[cowboy_tracer_h(3)]
diff --git a/doc/src/manual/cowboy_decompress_h.asciidoc b/doc/src/manual/cowboy_decompress_h.asciidoc
new file mode 100644
index 0000000..63ee0ee
--- /dev/null
+++ b/doc/src/manual/cowboy_decompress_h.asciidoc
@@ -0,0 +1,58 @@
+= cowboy_decompress_h(3)
+
+== Name
+
+cowboy_decompress_h - Decompress stream handler
+
+== Description
+
+The module `cowboy_decompress_h` decompresses request bodies
+automatically when the server supports it. Requests will
+only be decompressed when their compression ratio is lower
+than the configured limit. Mismatch of the content and
+`content-encoding` is rejected with `400 Bad Request`.
+
+== Options
+
+[source,erlang]
+----
+opts() :: #{
+ decompress_ratio_limit => non_neg_integer(),
+ decompress_ignore => boolean()
+}
+----
+
+Configuration for the decompress stream handler.
+
+The default value is given next to the option name:
+
+decompress_ratio_limit (20)::
+The max ratio of the compressed and decompressed body
+before it is rejected with `413 Payload Too Large`.
++
+This option can be updated at any time using the
+`set_options` stream handler command.
+
+decompress_ignore (false)::
+
+Whether the handler will be ignored.
++
+This option can be updated at any time using the
+`set_options` stream handler command.
+
+== Events
+
+The decompress stream handler does not produce any event.
+
+== Changelog
+
+* *2.11*: Module introduced.
+
+== See also
+
+link:man:cowboy(7)[cowboy(7)],
+link:man:cowboy_stream(3)[cowboy_stream(3)],
+link:man:cowboy_compress_h(3)[cowboy_compress_h(3)],
+link:man:cowboy_metrics_h(3)[cowboy_metrics_h(3)],
+link:man:cowboy_stream_h(3)[cowboy_stream_h(3)],
+link:man:cowboy_tracer_h(3)[cowboy_tracer_h(3)]
diff --git a/doc/src/manual/cowboy_metrics_h.asciidoc b/doc/src/manual/cowboy_metrics_h.asciidoc
index c871d57..801bdbb 100644
--- a/doc/src/manual/cowboy_metrics_h.asciidoc
+++ b/doc/src/manual/cowboy_metrics_h.asciidoc
@@ -160,5 +160,6 @@ The metrics stream handler does not produce any event.
link:man:cowboy(7)[cowboy(7)],
link:man:cowboy_stream(3)[cowboy_stream(3)],
link:man:cowboy_compress_h(3)[cowboy_compress_h(3)],
+link:man:cowboy_decompress_h(3)[cowboy_decompress_h(3)],
link:man:cowboy_stream_h(3)[cowboy_stream_h(3)],
link:man:cowboy_tracer_h(3)[cowboy_tracer_h(3)]
diff --git a/doc/src/manual/cowboy_stream_h.asciidoc b/doc/src/manual/cowboy_stream_h.asciidoc
index c25aa3d..588346e 100644
--- a/doc/src/manual/cowboy_stream_h.asciidoc
+++ b/doc/src/manual/cowboy_stream_h.asciidoc
@@ -69,5 +69,6 @@ may not work properly if they are executed
link:man:cowboy(7)[cowboy(7)],
link:man:cowboy_stream(3)[cowboy_stream(3)],
link:man:cowboy_compress_h(3)[cowboy_compress_h(3)],
+link:man:cowboy_decompress_h(3)[cowboy_decompress_h(3)],
link:man:cowboy_metrics_h(3)[cowboy_metrics_h(3)],
link:man:cowboy_tracer_h(3)[cowboy_tracer_h(3)]
diff --git a/doc/src/manual/cowboy_tracer_h.asciidoc b/doc/src/manual/cowboy_tracer_h.asciidoc
index e3592e4..4f4e9bc 100644
--- a/doc/src/manual/cowboy_tracer_h.asciidoc
+++ b/doc/src/manual/cowboy_tracer_h.asciidoc
@@ -84,5 +84,6 @@ The tracer stream handler does not produce any event.
link:man:cowboy(7)[cowboy(7)],
link:man:cowboy_stream(3)[cowboy_stream(3)],
link:man:cowboy_compress_h(3)[cowboy_compress_h(3)],
+link:man:cowboy_decompress_h(3)[cowboy_decompress_h(3)],
link:man:cowboy_metrics_h(3)[cowboy_metrics_h(3)],
link:man:cowboy_stream_h(3)[cowboy_stream_h(3)]