Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Render embedded remote documents with the embed template #11752

Closed
giohappy opened this issue Dec 6, 2023 · 0 comments · Fixed by #11753
Closed

Render embedded remote documents with the embed template #11752

giohappy opened this issue Dec 6, 2023 · 0 comments · Fixed by #11753
Assignees

Comments

@giohappy
Copy link
Contributor

giohappy commented Dec 6, 2023

At the moment the embed URL for remote documents returns a redirection to the remote URL. This automatically makes the browser show the preview if the remote document doesn't have the content-disposition set, otherwise the download of the document is automatically triggered instead of showing the preview.

The client has implemented a new mechanism in GeoNode/geonode-mapstore-client#1642 to:

  • test if the remote resource has CORS enabled -> the document is downloadad and the Blob for the iframe is created
  • if CORS is disabled it tried to get it through the GeoNode proxy -> if the proxy has the remote host set in the PROXY_ALLOWED_HOSTS it retrieves the remote document -> the document is downloadad and the Blob for the iframe is created
  • if all the above steps fail the client doesn't show the preview

With this support from the client side we can make the document embed template render also for remote documents, instead of redirecting to the remote URL.

@giohappy giohappy self-assigned this Dec 6, 2023
@giohappy giohappy linked a pull request Dec 6, 2023 that will close this issue
12 tasks
giohappy added a commit that referenced this issue Dec 6, 2023
* render remote docs with document embed template

* removed unused import

* revert removed unused import

* removed unused import
github-actions bot pushed a commit that referenced this issue Dec 6, 2023
* render remote docs with document embed template

* removed unused import

* revert removed unused import

* removed unused import

(cherry picked from commit 849265c)
giohappy added a commit that referenced this issue Dec 6, 2023
… (#11754)

* render remote docs with document embed template

(cherry picked from commit 849265c)

Co-authored-by: Giovanni Allegri <giohappy@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant