Skip to content

Commit e8cb240

Browse files
committed
Change send_continue() into send_info() as per feedback
1 parent 0001a0f commit e8cb240

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/server.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -1049,18 +1049,19 @@ impl<B: Buf> SendResponse<B> {
10491049
.map_err(Into::into)
10501050
}
10511051

1052-
/// Send a 100-continue response to a client request.
1052+
/// Send a non-final 1xx response to a client request.
10531053
///
10541054
/// The [`SendResponse`] instance is already associated with a received
1055-
/// request. This function may only be called once per instance and only if
1056-
/// [`send_reset`] or [`send_response`] has not been previously called.
1055+
/// request. This function may only be called if [`send_reset`] or
1056+
/// [`send_response`] has not been previously called.
10571057
///
10581058
/// [`SendResponse`]: #
10591059
/// [`send_reset`]: #method.send_reset
10601060
/// [`send_response`]: #method.send_response
1061-
pub fn send_continue(&mut self) -> Result<(), crate::Error> {
1061+
pub fn send_info(&mut self, response: Response<()>) -> Result<(), crate::Error> {
1062+
assert!(response.status().is_informational());
10621063
self.inner
1063-
.send_response(Response::builder().status(100).body(()).unwrap(), false)
1064+
.send_response(response, false)
10641065
.map_err(Into::into)
10651066
}
10661067

0 commit comments

Comments
 (0)