[ 
https://issues.apache.org/jira/browse/MESOS-5911?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15394997#comment-15394997
 ] 

haosdent edited comment on MESOS-5911 at 7/27/16 3:24 AM:
----------------------------------------------------------

[~xujyan] We could use jsonp to avoid the CORS problem directly. But my bad 
didn't include params when redirection in this [patch | 
https://reviews.apache.org/r/34646] before.

It requires fix 
{code}
diff --git a/src/master/http.cpp b/src/master/http.cpp
index 1cbec97..f60b181 100644
--- a/src/master/http.cpp
+++ b/src/master/http.cpp
@@ -2035,7 +2035,7 @@ Future<Response> Master::Http::redirect(const Request& 
request) const
     // base url of leading master to avoid infinite redirect loop.
     return TemporaryRedirect(basePath);
   } else {
-    return TemporaryRedirect(basePath + request.url.path);
+    return TemporaryRedirect(basePath + stringify(request.url));
   }
 }
{code}


was (Author: [email protected]):
[~xujyan] We could use jsonp to avoid the CORS problem directly. But my bad 
didn't include params when redirection in this [patch | 
https://reviews.apache.org/r/34646].

> Webui redirection to leader in browser does not work
> ----------------------------------------------------
>
>                 Key: MESOS-5911
>                 URL: https://issues.apache.org/jira/browse/MESOS-5911
>             Project: Mesos
>          Issue Type: Bug
>    Affects Versions: 1.0.0
>            Reporter: Jacob Janco
>            Assignee: haosdent
>            Priority: Blocker
>              Labels: webui
>
> We deployed 1.0.0-rc4 in a small test cluster with 3 masters/5 agents. 
> Redirection to master curling for state.json returned the expected 307, 
> however, in browser (chrome/safari/firefox), redirection failed with: 
> {code}
> XMLHttpRequest cannot load <master_url_1>:5050/master/state. No 
> 'Access-Control-Allow-Origin' header is present on the requested resource. 
> Origin '<master_url_2>:5050' is therefore not allowed access.
> {code}
> This is the patch that introduced the redirect on /state (and HTTP calls): 
> https://reviews.apache.org/r/34646
> The issue is that before this change, the server side does not redirect, the 
> web UI controller.js decides from the content of the state.json which leader 
> to redirect and then invoke redirection itself. Browsers allow this but not 
> the server side initiated redirect without 'Access-Control-Allow-Origin' 
> header?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to