Skip to content

Commit ea10882

Browse files
etrclaude
andcommitted
Fix CI: cpplint cleanup and create_test_request method uppercase
- src/create_test_request.cpp: uppercase method via to_upper_copy so create_test_request_suite/method_uppercase passes (`.method("post")` -> `POST`); fix cpplint header order. - src/http_request.cpp: reorder includes to match cpplint convention (matching header, C system, C++ system, project) and add <utility> for std::move at line 363. - examples/empty_response_example.cpp: move <microhttpd.h> before <memory> to satisfy cpplint header ordering. - examples/url_registration.cpp: split a 215-char render() body to satisfy cpplint line-length cap (200). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 6d73c15 commit ea10882

4 files changed

Lines changed: 17 additions & 9 deletions

File tree

examples/empty_response_example.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@
1818
USA
1919
*/
2020

21+
#include <microhttpd.h>
22+
2123
#include <memory>
2224

23-
#include <microhttpd.h>
2425
#include <httpserver.hpp>
2526

2627
class no_content_resource : public httpserver::http_resource {

examples/url_registration.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ class handling_multiple_resource : public httpserver::http_resource {
4040
class url_args_resource : public httpserver::http_resource {
4141
public:
4242
std::shared_ptr<httpserver::http_response> render(const httpserver::http_request& req) {
43-
return std::shared_ptr<httpserver::http_response>(new httpserver::http_response(httpserver::http_response::string("ARGS: " + std::string(req.get_arg("arg1")) + " and " + std::string(req.get_arg("arg2")))));
43+
std::string body = "ARGS: " + std::string(req.get_arg("arg1"))
44+
+ " and " + std::string(req.get_arg("arg2"));
45+
return std::shared_ptr<httpserver::http_response>(
46+
new httpserver::http_response(httpserver::http_response::string(body)));
4447
}
4548
};
4649

src/create_test_request.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@
2020
*/
2121

2222
#include "httpserver/create_test_request.hpp"
23-
#include "httpserver/detail/http_request_impl.hpp"
2423

2524
#include <memory>
2625
#include <string>
2726
#include <utility>
2827

28+
#include "httpserver/detail/http_request_impl.hpp"
29+
#include "httpserver/string_utilities.hpp"
30+
2931
namespace httpserver {
3032

3133
namespace {
@@ -50,7 +52,7 @@ http_request create_test_request::build() {
5052
req.impl_.reset(new detail::http_request_impl());
5153
req.impl_.get_deleter().fn = &delete_test_impl_heap;
5254

53-
req.set_method(_method);
55+
req.set_method(string_utilities::to_upper_copy(_method));
5456
req.set_path(_path);
5557
req.set_version(_version);
5658
req.set_content(_content);

src/http_request.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,11 @@
2020
*/
2121

2222
#include "httpserver/http_request.hpp"
23-
#include "httpserver/detail/http_request_impl.hpp"
24-
// TASK-016: pull in connection_state to read the per-connection arena
25-
// out of MHD on impl construction. Both headers are gated by
26-
// HTTPSERVER_COMPILATION so this stays internal.
27-
#include "httpserver/detail/webserver_impl.hpp"
2823

2924
#include <inttypes.h>
3025
#include <stdio.h>
3126
#include <stdlib.h>
27+
3228
#include <algorithm>
3329
#include <atomic>
3430
#include <iostream>
@@ -37,8 +33,14 @@
3733
#include <memory_resource>
3834
#include <string>
3935
#include <tuple>
36+
#include <utility>
4037
#include <vector>
4138

39+
// TASK-016: pull in connection_state to read the per-connection arena
40+
// out of MHD on impl construction. Both headers are gated by
41+
// HTTPSERVER_COMPILATION so this stays internal.
42+
#include "httpserver/detail/http_request_impl.hpp"
43+
#include "httpserver/detail/webserver_impl.hpp"
4244
#include "httpserver/http_utils.hpp"
4345
#include "httpserver/string_utilities.hpp"
4446

0 commit comments

Comments
 (0)