Skip to content
Snippets Groups Projects
Commit ace64781 authored by alexey.stratulat's avatar alexey.stratulat
Browse files

[+] Added temporary implementation of handling a simple CORS request. Moved...

[+] Added temporary implementation of handling a simple CORS request. Moved from the features-5056 branch.
parent 7b6f1abf
No related branches found
No related tags found
3 merge requests!512bugfix-5760,!501Update dap_chain_global_db_driver_cdb.c - removed unused piece of code (added by bugfix5456),!427Correction in the implementation of JSON-RPC and added processing of simple CORS requests in dap_http_simple.
......@@ -351,6 +351,14 @@ static void s_http_client_headers_read( dap_http_client_t *a_http_client, void *
l_http_simple->reply_size_max = DAP_HTTP_SIMPLE_URL_PROC( a_http_client->proc )->reply_size_max;
l_http_simple->reply_byte = DAP_NEW_Z_SIZE(uint8_t, DAP_HTTP_SIMPLE(a_http_client)->reply_size_max );
// Made a temporary solution to handle simple CORS requests.
// This is necessary in order to be able to request information using JavaScript obtained from another source.
dap_http_header_t* l_header_origin = dap_http_header_find(a_http_client->in_headers, "Origin");
if (l_header_origin){
dap_http_out_header_add(a_http_client, "Access-Control-Allow-Origin", "*");
}
if( a_http_client->in_content_length ) {
// dbg if( a_http_client->in_content_length < 3){
if( a_http_client->in_content_length > 0){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment