rusackas commented on code in PR #43600:
URL: https://github.com/apache/superset/pull/43600#discussion_r3875338443


##########
docs/docs/using-superset/embedding.mdx:
##########
@@ -88,6 +88,19 @@ embedDashboard({
 
 If the callback returns `null` or is not provided, Superset uses its own 
permalink URL as a fallback.
 
+### Permalink origin rewriting
+
+Separately from `resolvePermalinkUrl`, Superset itself rewrites the origin of 
any permalink URL it generates to `window.location.origin` before showing it to 
the user. This keeps a proxied or subdirectory-deployed Superset from handing 
out a permalink that points at an internal hostname the user's browser can't 
reach.
+

Review Comment:
   Reworded — this only covers the non-embedded fallback path. Embedded 
permalinks (callback result or the untouched backend URL when none is provided) 
skip the rewrite entirely, and the doc now says so.



##########
docs/docs/using-superset/embedding.mdx:
##########
@@ -88,6 +88,19 @@ embedDashboard({
 
 If the callback returns `null` or is not provided, Superset uses its own 
permalink URL as a fallback.
 
+### Permalink origin rewriting
+
+Separately from `resolvePermalinkUrl`, Superset itself rewrites the origin of 
any permalink URL it generates to `window.location.origin` before showing it to 
the user. This keeps a proxied or subdirectory-deployed Superset from handing 
out a permalink that points at an internal hostname the user's browser can't 
reach.
+
+If your reverse proxy correctly forwards `X-Forwarded-Host` and you'd rather 
permalinks carry the backend's literal origin, opt out of the rewrite with 
`EMBEDDED_DISABLE_PERMALINK_ORIGIN_REWRITE`:
+
+```python
+# superset_config.py
+EMBEDDED_DISABLE_PERMALINK_ORIGIN_REWRITE = True
+```

Review Comment:
   Same fix — the section now says the flag only affects non-embedded 
permalinks and has no effect on embedded callback or fallback URLs.



##########
docs/docs/using-superset/embedding.mdx:
##########
@@ -88,6 +88,19 @@ embedDashboard({
 
 If the callback returns `null` or is not provided, Superset uses its own 
permalink URL as a fallback.
 
+### Permalink origin rewriting
+
+Separately from `resolvePermalinkUrl`, Superset itself rewrites the origin of 
any permalink URL it generates to `window.location.origin` before showing it to 
the user. This keeps a proxied or subdirectory-deployed Superset from handing 
out a permalink that points at an internal hostname the user's browser can't 
reach.

Review Comment:
   Reworded to say the rewrite is the non-embedded fallback and the flag only 
affects that path.



-- 
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