diff options
author | Jake Farrell <jfarrell@apache.org> | 2012-08-22 02:57:07 +0000 |
---|---|---|
committer | Jake Farrell <jfarrell@apache.org> | 2012-08-22 02:57:07 +0000 |
commit | afd3ab2714fd3a5736dd86a193b800bb0a9a5f37 (patch) | |
tree | 87c5fd0a11c4352fb415faf3d5c017f03a283cfd | |
parent | 2853cc0adffae223e0861524eb8e23af03b7a19b (diff) | |
download | thrift-afd3ab2714fd3a5736dd86a193b800bb0a9a5f37.tar.gz |
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
-rw-r--r-- | lib/cpp/src/thrift/transport/THttpServer.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/cpp/src/thrift/transport/THttpServer.cpp b/lib/cpp/src/thrift/transport/THttpServer.cpp index b10e6da39..d72319679 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 << |