Skip to content

Commit

Permalink
const getter + nodiscard
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Müller committed Feb 11, 2025
1 parent 321b35d commit a9466f7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions cpr/session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,10 @@ Header& Session::GetHeader() {
return header_;
}

const Header& Session::GetHeader() const {
return header_;
}

void Session::SetTimeout(const Timeout& timeout) {
curl_easy_setopt(curl_->handle, CURLOPT_TIMEOUT_MS, timeout.Milliseconds());
}
Expand Down
2 changes: 1 addition & 1 deletion include/cpr/session.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class Session : public std::enable_shared_from_this<Session> {
void SetParameters(Parameters&& parameters);
void SetHeader(const Header& header);
void UpdateHeader(const Header& header);
Header& GetHeader();
[[nodiscard]] Header& GetHeader();
[[nodiscard]] const Header& GetHeader() const;
void SetTimeout(const Timeout& timeout);
void SetConnectTimeout(const ConnectTimeout& timeout);
Expand Down

0 comments on commit a9466f7

Please sign in to comment.