From reviews-return-41751-apmail-mesos-reviews-archive=mesos.apache.org@mesos.apache.org Fri Jul 29 23:46:04 2016 Return-Path: X-Original-To: apmail-mesos-reviews-archive@minotaur.apache.org Delivered-To: apmail-mesos-reviews-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 44B33198EA for ; Fri, 29 Jul 2016 23:46:04 +0000 (UTC) Received: (qmail 38219 invoked by uid 500); 29 Jul 2016 23:46:04 -0000 Delivered-To: apmail-mesos-reviews-archive@mesos.apache.org Received: (qmail 38190 invoked by uid 500); 29 Jul 2016 23:46:04 -0000 Mailing-List: contact reviews-help@mesos.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: reviews@mesos.apache.org Delivered-To: mailing list reviews@mesos.apache.org Received: (qmail 38163 invoked by uid 99); 29 Jul 2016 23:46:03 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Jul 2016 23:46:03 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id 573BD2BE71D; Fri, 29 Jul 2016 23:46:02 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============8809706164660925549==" MIME-Version: 1.0 Subject: Re: Review Request 50482: Fixed the CORS error when redirect in WEB UI. From: Jiang Yan Xu To: Jie Yu , Adam B , Vinod Kone , Jiang Yan Xu , =?utf-8?q?Michael_Lun=C3=B8e?= Cc: haosdent huang , mesos Date: Fri, 29 Jul 2016 23:46:02 -0000 Message-ID: <20160729234602.11791.81703@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: Jiang Yan Xu X-ReviewGroup: mesos X-Auto-Response-Suppress: DR, RN, OOF, AutoReply X-ReviewRequest-URL: https://reviews.apache.org/r/50482/ X-Sender: Jiang Yan Xu X-ReviewBoard-ShipIt: 1 References: <20160729070242.11792.54915@reviews.apache.org> In-Reply-To: <20160729070242.11792.54915@reviews.apache.org> Reply-To: Jiang Yan Xu X-ReviewRequest-Repository: mesos --===============8809706164660925549== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/50482/#review144221 ----------------------------------------------------------- Ship it! src/webui/master/static/js/controllers.js (lines 375 - 378) Committing with minor comment tweaking ``` // When the current master is not the leader, the request is redirected to // the leading master automatically. This would cause a CORS error if we // use XMLHttpRequest here. To avoid the CORS error, we use JSONP as a // workaround. Please refer to MESOS-5911 for further details. ``` - Jiang Yan Xu On July 29, 2016, 12:02 a.m., haosdent huang wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/50482/ > ----------------------------------------------------------- > > (Updated July 29, 2016, 12:02 a.m.) > > > Review request for mesos, Adam B, Jie Yu, Michael Lunøe, Vinod Kone, and Jiang Yan Xu. > > > Bugs: MESOS-5911 > https://issues.apache.org/jira/browse/MESOS-5911 > > > Repository: mesos > > > Description > ------- > > The redirection in WEB UI is broken since the CORS restriction after > we enabled redirection in `master/state` endpoint in > https://reviews.apache.org/r/34646/. We change the request way to > `master/state` endpoint from xhr to jsonp for bypassing the CORS > restriction. > > > Diffs > ----- > > src/webui/master/static/index.html a083537cd718162d1913842bddbd2653d8c52337 > src/webui/master/static/js/controllers.js ceaf1402ebdae4efd1a8a6fc9c7b795de69e2fc0 > > Diff: https://reviews.apache.org/r/50482/diff/ > > > Testing > ------- > > Testing video record > > ![http_redirect.gif](https://issues.apache.org/jira/secure/attachment/12820401/http_redirect.gif) > > > Thanks, > > haosdent huang > > --===============8809706164660925549==--