File tree Expand file tree Collapse file tree 1 file changed +19
-18
lines changed
Expand file tree Collapse file tree 1 file changed +19
-18
lines changed Original file line number Diff line number Diff line change @@ -165,6 +165,25 @@ if subsystem == "http" then
165165 end
166166 register_getter (" headers_sent" , headers_sent )
167167
168+
169+ -- ngx.req.is_internal
170+
171+
172+ function ngx .req .is_internal ()
173+ local r = get_request ()
174+ if not r then
175+ error (" no request found" )
176+ end
177+
178+ local rc = C .ngx_http_lua_ffi_req_is_internal (r )
179+
180+ if rc == FFI_BAD_CONTEXT then
181+ error (" API disabled in the current context" )
182+ end
183+
184+ return rc == 1
185+ end
186+
168187elseif subsystem == " stream" then
169188 ffi .cdef [[
170189 int ngx_stream_lua_ffi_get_resp_status (ngx_stream_lua_request_t * r );
236255_M ._VERSION = base .version
237256
238257
239- -- ngx.req.is_internal
240-
241- function ngx .req .is_internal ()
242- local r = get_request ()
243- if not r then
244- error (" no request found" )
245- end
246-
247- local rc = C .ngx_http_lua_ffi_req_is_internal (r )
248-
249- if rc == FFI_BAD_CONTEXT then
250- error (" API disabled in the current context" )
251- end
252-
253- return rc == 1
254- end
255-
256-
257258return _M
You can’t perform that action at this time.
0 commit comments