Skip to content

Commit 2166056

Browse files
committed
fix basic_auth_fail and create_webserver
1 parent 0dae021 commit 2166056

File tree

3 files changed

+347
-281
lines changed

3 files changed

+347
-281
lines changed

src/httpserver.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@
3434
#include "httpserver/string_response.hpp"
3535
#include "httpserver/webserver.hpp"
3636

37-
#endif
37+
#endif // SRC_HTTPSERVER_HPP_

src/httpserver/basic_auth_fail_response.hpp

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
#error "Only <httpserver.hpp> or <httpserverpp> can be included directly."
2323
#endif
2424

25-
#ifndef _BASIC_AUTH_FAIL_RESPONSE_HPP_
26-
#define _BASIC_AUTH_FAIL_RESPONSE_HPP_
25+
#ifndef SRC_HTTPSERVER_BASIC_AUTH_FAIL_RESPONSE_HPP_
26+
#define SRC_HTTPSERVER_BASIC_AUTH_FAIL_RESPONSE_HPP_
2727

2828
#include <string>
2929
#include "http_utils.hpp"
@@ -32,37 +32,33 @@
3232
struct MHD_Connection;
3333
struct MHD_Response;
3434

35-
namespace httpserver
36-
{
35+
namespace httpserver {
3736

38-
class basic_auth_fail_response : public string_response
39-
{
40-
public:
41-
basic_auth_fail_response() = default;
37+
class basic_auth_fail_response : public string_response {
38+
public:
39+
basic_auth_fail_response() = default;
4240

43-
explicit basic_auth_fail_response(
41+
explicit basic_auth_fail_response(
4442
const std::string& content,
4543
const std::string& realm = "",
4644
int response_code = http::http_utils::http_ok,
47-
const std::string& content_type = http::http_utils::text_plain
48-
):
45+
const std::string& content_type = http::http_utils::text_plain):
4946
string_response(content, response_code, content_type),
50-
realm(realm)
51-
{
47+
realm(realm) {
5248
}
5349

54-
basic_auth_fail_response(const basic_auth_fail_response& other) = default;
55-
basic_auth_fail_response(basic_auth_fail_response&& other) noexcept = default;
56-
basic_auth_fail_response& operator=(const basic_auth_fail_response& b) = default;
57-
basic_auth_fail_response& operator=(basic_auth_fail_response&& b) = default;
50+
basic_auth_fail_response(const basic_auth_fail_response& other) = default;
51+
basic_auth_fail_response(basic_auth_fail_response&& other) noexcept = default;
52+
basic_auth_fail_response& operator=(const basic_auth_fail_response& b) = default;
53+
basic_auth_fail_response& operator=(basic_auth_fail_response&& b) = default;
5854

59-
~basic_auth_fail_response() = default;
55+
~basic_auth_fail_response() = default;
6056

61-
int enqueue_response(MHD_Connection* connection, MHD_Response* response);
57+
int enqueue_response(MHD_Connection* connection, MHD_Response* response);
6258

63-
private:
64-
std::string realm = "";
59+
private:
60+
std::string realm = "";
6561
};
6662

67-
}
68-
#endif // _BASIC_AUTH_FAIL_RESPONSE_HPP_
63+
} // namespace httpserver
64+
#endif // SRC_HTTPSERVER_BASIC_AUTH_FAIL_RESPONSE_HPP_

0 commit comments

Comments
 (0)