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

Commit

Permalink
Merge pull request #91 from DLTcollab/develop
Browse files Browse the repository at this point in the history
Bump version to v0.2.1
  • Loading branch information
Wu Yu Wei committed Mar 6, 2019
2 parents 8cd15f8 + 7cb1187 commit 0ce6158
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions accelerator/server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ 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.set_header("Access-Control-Allow-Origin", "*");
res << json_result;
});

Expand All @@ -64,7 +65,8 @@ 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.set_header("Access-Control-Allow-Origin", "*");
res << json_result;
});

Expand All @@ -85,7 +87,8 @@ 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.set_header("Access-Control-Allow-Origin", "*");
res << json_result;
});

Expand All @@ -103,7 +106,8 @@ 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.set_header("Access-Control-Allow-Origin", "*");
res << json_result;
});

Expand All @@ -121,7 +125,8 @@ 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.set_header("Access-Control-Allow-Origin", "*");
res << json_result;
});

Expand All @@ -139,7 +144,8 @@ 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.set_header("Access-Control-Allow-Origin", "*");
res << json_result;
});

Expand Down Expand Up @@ -169,7 +175,8 @@ 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.set_header("Access-Control-Allow-Origin", "*");
res << json_result;
});

Expand All @@ -190,7 +197,8 @@ 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.set_header("Access-Control-Allow-Origin", "*");
res << json;

cJSON_Delete(json_obj);
Expand Down

0 comments on commit 0ce6158

Please sign in to comment.