Skip to content
This repository has been archived by the owner on Dec 26, 2022. It is now read-only.

Commit

Permalink
fix: Correct response Content-Type header
Browse files Browse the repository at this point in the history
According to the W3C specification, the media type header should be
"Content-Type".

See-also: https://tools.ietf.org/html/rfc7231#section-3.1.1.5
  • Loading branch information
ender503 committed Mar 5, 2019
1 parent 8cd15f8 commit 8539ce9
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions accelerator/server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ int main(int, char const**) {

api_find_transactions_by_tag(&service, req.params["tag"].c_str(),
&json_result);
res.set_header("content-type", "application/json");
res.set_header("Content-Type", "application/json");
res << json_result;
});

Expand All @@ -64,7 +64,7 @@ int main(int, char const**) {

api_get_transaction_object(&service, req.params["tx"].c_str(),
&json_result);
res.set_header("content-type", "application/json");
res.set_header("Content-Type", "application/json");
res << json_result;
});

Expand All @@ -85,7 +85,7 @@ int main(int, char const**) {

api_find_transactions_obj_by_tag(&service, req.params["tag"].c_str(),
&json_result);
res.set_header("content-type", "application/json");
res.set_header("Content-Type", "application/json");
res << json_result;
});

Expand All @@ -103,7 +103,7 @@ int main(int, char const**) {
char* json_result;

api_get_tips_pair(&service, &json_result);
res.set_header("content-type", "application/json");
res.set_header("Content-Type", "application/json");
res << json_result;
});

Expand All @@ -121,7 +121,7 @@ int main(int, char const**) {
char* json_result;

api_get_tips(&service, &json_result);
res.set_header("content-type", "application/json");
res.set_header("Content-Type", "application/json");
res << json_result;
});

Expand All @@ -139,7 +139,7 @@ int main(int, char const**) {
char* json_result;

api_generate_address(&service, &json_result);
res.set_header("content-type", "application/json");
res.set_header("Content-Type", "application/json");
res << json_result;
});

Expand Down Expand Up @@ -169,7 +169,7 @@ int main(int, char const**) {
api_send_transfer(&service, req.body().c_str(), &json_result);
}

res.set_header("content-type", "application/json");
res.set_header("Content-Type", "application/json");
res << json_result;
});

Expand All @@ -190,7 +190,7 @@ int main(int, char const**) {
const char* json = cJSON_PrintUnformatted(json_obj);

res.set_status(SC_BAD_REQUEST);
res.set_header("content-type", "application/json");
res.set_header("Content-Type", "application/json");
res << json;

cJSON_Delete(json_obj);
Expand Down

0 comments on commit 8539ce9

Please sign in to comment.