skiaserve: Add CORS header, and debugger code is served over HTTPS.
authorjcgregorio <jcgregorio@google.com>
Thu, 28 Jan 2016 13:31:31 +0000 (05:31 -0800)
committerCommit bot <commit-bot@chromium.org>
Thu, 28 Jan 2016 13:31:31 +0000 (05:31 -0800)
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1646683002

Review URL: https://codereview.chromium.org/1646683002

tools/skiaserve/skiaserve.cpp

index b615d44..e0a17bf 100644 (file)
@@ -156,12 +156,13 @@ static int SendJSON(MHD_Connection* connection, SkPicture* picture) {
 
 static int SendTemplate(MHD_Connection* connection, bool redirect = false,
                         const char* redirectUrl = nullptr) {
-    SkString debuggerTemplate = generateTemplate(SkString("http://debugger.skia.org"));
+    SkString debuggerTemplate = generateTemplate(SkString("https://debugger.skia.org"));
 
     MHD_Response* response = MHD_create_response_from_buffer(
         debuggerTemplate.size(),
         (void*) const_cast<char*>(debuggerTemplate.c_str()),
         MHD_RESPMEM_MUST_COPY);
+    MHD_add_response_header (response, "Access-Control-Allow-Origin", "*");
 
     int status = MHD_HTTP_OK;