From: Jake Farrell Date: Wed, 22 Aug 2012 02:57:07 +0000 (+0000) Subject: Thrift-1656: Setting proper headers in THttpServer.cpp so that "Cross-Origin Resource... X-Git-Tag: 0.9.1~318 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=afd3ab2714fd3a5736dd86a193b800bb0a9a5f37;p=common%2Fthrift.git 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 --- 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 <<