Skip to content

Commit 75ab35d

Browse files
authored
doc: add http2 and http3 limitation doc comment for ngx.req.socket API.
1 parent 0c3675f commit 75ab35d

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

README.markdown

+2
Original file line numberDiff line numberDiff line change
@@ -5643,6 +5643,8 @@ Returns a read-only cosocket object that wraps the downstream connection. Only [
56435643

56445644
In case of error, `nil` will be returned as well as a string describing the error.
56455645

5646+
Due to the streaming nature of HTTP2 and HTTP3, this API cannot be used when the downstream connection is HTTP2 and HTTP3.
5647+
56465648
The socket object returned by this method is usually used to read the current request's body in a streaming fashion. Do not turn on the [lua_need_request_body](#lua_need_request_body) directive, and do not mix this call with [ngx.req.read_body](#ngxreqread_body) and [ngx.req.discard_body](#ngxreqdiscard_body).
56475649

56485650
If any request body data has been pre-read into the Nginx core request header buffer, the resulting cosocket object will take care of this to avoid potential data loss resulting from such pre-reading.

doc/HttpLuaModule.wiki

+2
Original file line numberDiff line numberDiff line change
@@ -4741,6 +4741,8 @@ Returns a read-only cosocket object that wraps the downstream connection. Only [
47414741
47424742
In case of error, <code>nil</code> will be returned as well as a string describing the error.
47434743
4744+
Due to the streaming nature of HTTP2 and HTTP3, this API cannot be used when the downstream connection is HTTP2 and HTTP3.
4745+
47444746
The socket object returned by this method is usually used to read the current request's body in a streaming fashion. Do not turn on the [[#lua_need_request_body|lua_need_request_body]] directive, and do not mix this call with [[#ngx.req.read_body|ngx.req.read_body]] and [[#ngx.req.discard_body|ngx.req.discard_body]].
47454747
47464748
If any request body data has been pre-read into the Nginx core request header buffer, the resulting cosocket object will take care of this to avoid potential data loss resulting from such pre-reading.

0 commit comments

Comments
 (0)