hannespr commented on PR #38033:
URL: https://github.com/apache/superset/pull/38033#issuecomment-3986214968

   I think I found the problem:
   
   The logo url is wrapped with `ensureAppRoot`
   
   ```
             <StyledBrandLink href={ensureAppRoot(theme.brandLogoHref)}>
   ```
   
   but this method is not suited for external URLs - it will just mess them up. 
I am from the Java/Spring world :smile: - there I recently saw code which 
handles such cases like that:
   
   ```
   export function ensureAppRoot(path: string): string {
     if(path.beginsWith("http")
       return path
     ...
   ```
   
   If we assume that no one will start their internal paths with http... this 
is an effective way to detect external URLs which could also be implemented 
here. Brand URL should be typically external URL (I guess?), so a separate 
check, not using `ensureAppRoot` would also be fine in my opinion, although I 
like the first variant better as it is harder to get wrong.
   
   Regarding your question, I have configured my theme like this:
   
   ```
   {
       "algorithm": "default",
       "token": {
           "brandLogoHref": "https://example.com";
       }
   }
   ```
   
   which makes the upper left logo a link to that URL.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to