Skip to content

Commit

Permalink
http_protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
dimlev authored Oct 17, 2023
1 parent b0ee5fb commit e0bf6c8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/http/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit e0bf6c8

Please sign in to comment.