FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat: set header fields in response · expresscpp/expresscpp@04545e1 · GitHub

Commit 04545e1

Browse files
committed
feat: set header fields in response
1 parent 84fe623 commit 04545e1

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

‎include/expresscpp/response.hpp‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class Response {
1717
explicit Response(Session* session);
1818

1919
void SetStatus(const uint16_t status);
20+
void SetHeader(const std::string& key, const std::string& value);
2021

2122
void KeepAlive(bool alive);
2223

‎src/response.cpp‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ void Response::SetStatus(const uint16_t status) {
2121
res.result(status);
2222
}
2323

24+
void Response::SetHeader(const std::string& key, const std::string& value) {
25+
res.set(key, value);
26+
}
27+
2428
void Response::KeepAlive(bool alive) {
2529
res.keep_alive(alive);
2630
}

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL