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

Commit 0ce6158

Browse files
author
Wu Yu Wei
authored
Merge pull request #91 from DLTcollab/develop
Bump version to v0.2.1
2 parents 8cd15f8 + 7cb1187 commit 0ce6158

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

accelerator/server.cc

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ int main(int, char const**) {
4343

4444
api_find_transactions_by_tag(&service, req.params["tag"].c_str(),
4545
&json_result);
46-
res.set_header("content-type", "application/json");
46+
res.set_header("Content-Type", "application/json");
47+
res.set_header("Access-Control-Allow-Origin", "*");
4748
res << json_result;
4849
});
4950

@@ -64,7 +65,8 @@ int main(int, char const**) {
6465

6566
api_get_transaction_object(&service, req.params["tx"].c_str(),
6667
&json_result);
67-
res.set_header("content-type", "application/json");
68+
res.set_header("Content-Type", "application/json");
69+
res.set_header("Access-Control-Allow-Origin", "*");
6870
res << json_result;
6971
});
7072

@@ -85,7 +87,8 @@ int main(int, char const**) {
8587

8688
api_find_transactions_obj_by_tag(&service, req.params["tag"].c_str(),
8789
&json_result);
88-
res.set_header("content-type", "application/json");
90+
res.set_header("Content-Type", "application/json");
91+
res.set_header("Access-Control-Allow-Origin", "*");
8992
res << json_result;
9093
});
9194

@@ -103,7 +106,8 @@ int main(int, char const**) {
103106
char* json_result;
104107

105108
api_get_tips_pair(&service, &json_result);
106-
res.set_header("content-type", "application/json");
109+
res.set_header("Content-Type", "application/json");
110+
res.set_header("Access-Control-Allow-Origin", "*");
107111
res << json_result;
108112
});
109113

@@ -121,7 +125,8 @@ int main(int, char const**) {
121125
char* json_result;
122126

123127
api_get_tips(&service, &json_result);
124-
res.set_header("content-type", "application/json");
128+
res.set_header("Content-Type", "application/json");
129+
res.set_header("Access-Control-Allow-Origin", "*");
125130
res << json_result;
126131
});
127132

@@ -139,7 +144,8 @@ int main(int, char const**) {
139144
char* json_result;
140145

141146
api_generate_address(&service, &json_result);
142-
res.set_header("content-type", "application/json");
147+
res.set_header("Content-Type", "application/json");
148+
res.set_header("Access-Control-Allow-Origin", "*");
143149
res << json_result;
144150
});
145151

@@ -169,7 +175,8 @@ int main(int, char const**) {
169175
api_send_transfer(&service, req.body().c_str(), &json_result);
170176
}
171177

172-
res.set_header("content-type", "application/json");
178+
res.set_header("Content-Type", "application/json");
179+
res.set_header("Access-Control-Allow-Origin", "*");
173180
res << json_result;
174181
});
175182

@@ -190,7 +197,8 @@ int main(int, char const**) {
190197
const char* json = cJSON_PrintUnformatted(json_obj);
191198

192199
res.set_status(SC_BAD_REQUEST);
193-
res.set_header("content-type", "application/json");
200+
res.set_header("Content-Type", "application/json");
201+
res.set_header("Access-Control-Allow-Origin", "*");
194202
res << json;
195203

196204
cJSON_Delete(json_obj);

0 commit comments

Comments
 (0)