From afd3ab2714fd3a5736dd86a193b800bb0a9a5f37 Mon Sep 17 00:00:00 2001 From: Jake Farrell Date: Wed, 22 Aug 2012 02:57:07 +0000 Subject: [PATCH] Thrift-1656: Setting proper headers in THttpServer.cpp so that "Cross-Origin Resource Sharing" on js client can work. Client: cpp Patch: Shantanu Choudhary Set headers from server side, in the response, so that Javascript can handle Cross-site HTTP requests. git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1375883 13f79535-47bb-0310-9956-ffa450edef68 --- lib/cpp/src/thrift/transport/THttpServer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/cpp/src/thrift/transport/THttpServer.cpp b/lib/cpp/src/thrift/transport/THttpServer.cpp index b10e6da3..d7231967 100644 --- a/lib/cpp/src/thrift/transport/THttpServer.cpp +++ b/lib/cpp/src/thrift/transport/THttpServer.cpp @@ -88,6 +88,7 @@ void THttpServer::flush() { "HTTP/1.1 200 OK" << CRLF << "Date: " << getTimeRFC1123() << CRLF << "Server: Thrift/" << VERSION << CRLF << + "Access-Control-Allow-Origin: *" << CRLF << "Content-Type: application/x-thrift" << CRLF << "Content-Length: " << len << CRLF << "Connection: Keep-Alive" << CRLF << -- 2.17.1