diff --git a/src/asio_client_request.cc b/src/asio_client_request.cc index dd92422f..0db73c59 100644 --- a/src/asio_client_request.cc +++ b/src/asio_client_request.cc @@ -54,7 +54,7 @@ const std::string &request::method() const { return impl_->method(); } const header_map &request::header() const { return impl_->header(); } -request_impl &request::impl() { return *impl_; } +request_impl &request::impl() const { return *impl_; } } // namespace client } // namespace asio_http2 diff --git a/src/asio_client_response.cc b/src/asio_client_response.cc index b27039a9..4805422d 100644 --- a/src/asio_client_response.cc +++ b/src/asio_client_response.cc @@ -46,7 +46,7 @@ int64_t response::content_length() const { return impl_->content_length(); } const header_map &response::header() const { return impl_->header(); } -response_impl &response::impl() { return *impl_; } +response_impl &response::impl() const { return *impl_; } } // namespace client } // namespace asio_http2 diff --git a/src/asio_http2_handler.cc b/src/asio_http2_handler.cc index db458eea..704d90fd 100644 --- a/src/asio_http2_handler.cc +++ b/src/asio_http2_handler.cc @@ -66,7 +66,7 @@ void request::on_data(data_cb cb) const { void request::on_end(void_cb cb) const { return impl_->on_end(std::move(cb)); } -request_impl &request::impl() { return *impl_; } +request_impl &request::impl() const { return *impl_; } response::response() : impl_(make_unique()) {} @@ -85,7 +85,7 @@ unsigned int response::status_code() const { return impl_->status_code(); } bool response::started() const { return impl_->started(); } -response_impl &response::impl() { return *impl_; } +response_impl &response::impl() const { return *impl_; } request_impl::request_impl() : stream_(nullptr), pushed_(false) {} diff --git a/src/includes/nghttp2/asio_http2.h b/src/includes/nghttp2/asio_http2.h index 823eac29..778efec9 100644 --- a/src/includes/nghttp2/asio_http2.h +++ b/src/includes/nghttp2/asio_http2.h @@ -149,7 +149,7 @@ public: bool pushed() const; // Application must not call this directly. - request_impl &impl(); + request_impl &impl() const; private: std::unique_ptr impl_; @@ -183,7 +183,7 @@ public: bool started() const; // Application must not call this directly. - response_impl &impl(); + response_impl &impl() const; private: std::unique_ptr impl_; diff --git a/src/includes/nghttp2/asio_http2_client.h b/src/includes/nghttp2/asio_http2_client.h index 17bbe17a..2d391975 100644 --- a/src/includes/nghttp2/asio_http2_client.h +++ b/src/includes/nghttp2/asio_http2_client.h @@ -50,7 +50,7 @@ public: const header_map &header() const; - response_impl &impl(); + response_impl &impl() const; private: std::unique_ptr impl_; @@ -82,7 +82,7 @@ public: const header_map &header() const; - request_impl &impl(); + request_impl &impl() const; private: std::unique_ptr impl_;