From e0bf6c88399a6198df2b914ba02dfe1a9b1a7461 Mon Sep 17 00:00:00 2001 From: dimlev Date: Tue, 17 Oct 2023 14:21:47 +0300 Subject: [PATCH] http_protocol --- src/http/request.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/http/request.rs b/src/http/request.rs index f4efab8..c4a9d61 100644 --- a/src/http/request.rs +++ b/src/http/request.rs @@ -219,6 +219,11 @@ impl Request { } } + /// Retrieves the http protocol for this request. For example: "HTTP/2.0" + pub fn http_protocol(&self) -> &NgxStr { + unsafe { NgxStr::from_ngx_str(self.0.http_protocol) } + } + /// Set HTTP status of response. pub fn set_status(&mut self, status: HTTPStatus) { self.0.headers_out.status = status.into();