-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor how server header is populated
now it generated in one place little fancy on the cmake with private features, requires C++ 17 compiler, conanfile needs conan-io/conan#8002
- Loading branch information
1 parent
c66f226
commit 9cd8a97
Showing
14 changed files
with
90 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// MIT License | ||
|
||
#include "add_headers.hpp" | ||
|
||
#include <fmt/compile.h> | ||
#include <restinio/version.hpp> | ||
|
||
#include "um/user_management.hpp" | ||
|
||
namespace handler { | ||
namespace response { | ||
namespace impl { | ||
std::string server_declaration() { | ||
return fmt::format(FMT_COMPILE("user-management/{}; restinio/{}.{}.{}"), user_management::version, | ||
RESTINIO_VERSION_MAJOR, RESTINIO_VERSION_MINOR, RESTINIO_VERSION_PATCH); | ||
} | ||
} // namespace impl | ||
} // namespace response | ||
} // namespace handler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// MIT License | ||
|
||
#ifndef HANDLERS_UTILITY_ADD_HEADERS_HPP_ | ||
#define HANDLERS_UTILITY_ADD_HEADERS_HPP_ | ||
|
||
#include <restinio/http_headers.hpp> | ||
|
||
#include <chrono> | ||
#include <utility> | ||
|
||
namespace handler { | ||
namespace response { | ||
namespace impl { | ||
std::string server_declaration(); | ||
|
||
template <class response_builder> | ||
response_builder add_generic_headers(response_builder builder) { | ||
builder.append_header(restinio::http_field::server, server_declaration()) | ||
.append_header_date_field(); | ||
return std::move(builder); | ||
} | ||
} // namespace impl | ||
} // namespace response | ||
} // namespace handler | ||
|
||
#endif // HANDLERS_UTILITY_ADD_HEADERS_HPP_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters