diff options
| author | Fuwn <[email protected]> | 2024-06-11 06:40:35 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-06-11 06:41:52 +0000 |
| commit | 970099af7deec70d3689c055ddaa7417e7b0cb7a (patch) | |
| tree | eae0d2e752d15c47c86a8eb176ba4feb820d4aa1 /maple | |
| parent | docs(readme): add options to docker (diff) | |
| download | archived-maple-970099af7deec70d3689c055ddaa7417e7b0cb7a.tar.xz archived-maple-970099af7deec70d3689c055ddaa7417e7b0cb7a.zip | |
build: switch from ninja to tup
Diffstat (limited to 'maple')
| -rw-r--r-- | maple/titan.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/maple/titan.cc b/maple/titan.cc index 7f838f3..03ea19e 100644 --- a/maple/titan.cc +++ b/maple/titan.cc @@ -39,15 +39,15 @@ auto parameters_to_map(const std::vector<std::string> ¶meters) parameter.erase(0, parameter_delimiter_position + 1); // Add the key and value to `parameters_map` - parameters_map[key] = parameter; + parameters_map.at(key) = parameter; } return parameters_map; } auto handle_client(std::stringstream &response, std::string path, - const std::string &titan_token, size_t titan_max_size) - -> void { + const std::string &titan_token, + size_t titan_max_size) -> void { std::vector<std::string> parameters; // Find path in `path` size_t delimiter_position = path.find(';'); @@ -121,7 +121,8 @@ auto handle_client(std::stringstream &response, std::string path, } try { - size_t body_size = static_cast<size_t>(std::stoi(parameters_map["size"])); + size_t body_size = + static_cast<size_t>(std::stoi(parameters_map.at("size"))); if (body_size > titan_max_size) { response << "20 text/gemini\r\nThe server (Maple) received a body " @@ -141,7 +142,7 @@ auto handle_client(std::stringstream &response, std::string path, update_path = "/index.gmi"; } - if (parameters_map["token"] == titan_token) { + if (parameters_map.at("token") == titan_token) { std::ofstream file(".maple/gmi" + update_path); file << body; |