You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Clean up src/confighttp.cpp: remove unused <set> include, simplify shared_ptr typedefs, and apply const correctness (make 'now' const and use const auto for header/query iterators and token lookup). Use if-with-init for authorization, origin and referer header checks and for parsing Basic auth and CSRF token index. Tighten origin prefix validation to require ":" or "/" after allowed origins. Make numerous small comment/grammar tweaks and minor formatting clarifications to improve readability and robustness.
// Special handling for welcome page: redirect if username is already set
468
+
// Special handling for welcome page: redirect if the username is already set
476
469
if (redirect_if_username && !config::sunshine.username.empty()) {
477
470
send_redirect(response, request, "/");
478
471
return;
@@ -555,7 +548,7 @@ namespace confighttp {
555
548
// .relative_path is needed to shed any leading slash that might exist in the request path
556
549
auto filePath = fs::weakly_canonical(webDirPath / fs::path(request->path).relative_path());
557
550
558
-
// Don't do anything if file does not exist or is outside the assets directory
551
+
// Don't do anything if the file does not exist or is outside the assets directory
559
552
if (!isChildPath(filePath, nodeModulesPath)) {
560
553
BOOST_LOG(warning) << "Someone requested a path " << filePath << " that is outside the assets folder";
561
554
bad_request(response, request);
@@ -668,7 +661,7 @@ namespace confighttp {
668
661
}
669
662
670
663
/**
671
-
* @brief Save an application. To save a new application the index must be `-1`. To update an existing application, you must provide the current index of the application.
664
+
* @brief Save an application. To save a new application, the index must be `-1`. To update an existing application, you must provide the current index of the application.
672
665
* @param response The HTTP response object.
673
666
* @param request The HTTP request object.
674
667
* The body for the post request should be JSON serialized in the following format:
@@ -733,7 +726,7 @@ namespace confighttp {
733
726
}
734
727
735
728
auto &apps_node = file_tree["apps"];
736
-
int index = input_tree["index"].get<int>(); // this will intentionally cause exception if the provided value is the wrong type
729
+
int index = input_tree["index"].get<int>(); // this will intentionally cause an exception if the provided value is the wrong type
737
730
738
731
input_tree.erase("index");
739
732
@@ -870,7 +863,7 @@ namespace confighttp {
870
863
* @brief Unpair a client.
871
864
* @param response The HTTP response object.
872
865
* @param request The HTTP request object.
873
-
* The body for the post request should be JSON serialized in the following format:
866
+
* The body for the POST request should be JSON serialized in the following format:
874
867
* @code{.json}
875
868
* {
876
869
* "uuid": "<uuid>"
@@ -987,7 +980,7 @@ namespace confighttp {
987
980
* @brief Save the configuration settings.
988
981
* @param response The HTTP response object.
989
982
* @param request The HTTP request object.
990
-
* The body for the post request should be JSON serialized in the following format:
983
+
* The body for the POST request should be JSON serialized in the following format:
991
984
* @code{.json}
992
985
* {
993
986
* "key": "value"
@@ -1025,8 +1018,8 @@ namespace confighttp {
1025
1018
continue;
1026
1019
}
1027
1020
1028
-
// v.dump() will dump valid json, which we do not want for strings in the config right now
1029
-
// we should migrate the config file to straight json and get rid of all this nonsense
1021
+
// v.dump() will dump valid json, which we do not want for strings in the config, right now
1022
+
// we should migrate the config file to straight JSON and get rid of all this nonsense
0 commit comments