From 351f83b83b2a6101ae2c89d6ed4e6855a9ef4ce6 Mon Sep 17 00:00:00 2001 From: Nicolas Favre-Felix Date: Sun, 9 Jan 2011 18:11:20 +0100 Subject: [PATCH] CORS fix. --- server.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server.c b/server.c index a5f6219..e07f349 100644 --- a/server.c +++ b/server.c @@ -126,7 +126,7 @@ on_options(struct evhttp_request *rq) { /* Cross-Origin Resource Sharing, CORS. */ evhttp_add_header(rq->output_headers, "Access-Control-Allow-Origin", "*"); - evhttp_send_reply(rq, 200, "OK", body); + evhttp_send_reply(rq, 200, "OK", NULL); return 1; } @@ -169,7 +169,8 @@ on_request(struct evhttp_request *rq, void *ctx) { #ifdef _EVENT2_HTTP_H_ case EVHTTP_REQ_OPTIONS: - return on_options(rq); + on_options(rq); + return; #endif default: