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

fix: copy headers from StreamResource to VaadinResponse #209

Merged
merged 3 commits into from
Mar 8, 2022

Conversation

mcollovati
Copy link
Contributor

Description

Copy all headers set on a StreamResource to VaadinResponse before writing contents.
Also added support for absolute URLs in PortletStreamResourceRegistry.

Fixes #203

Type of change

  • Bugfix
  • Feature

Checklist

  • I have read the contribution guide: https://vaadin.com/docs/latest/guide/contributing/overview/
  • I have added a description following the guideline.
  • The issue is created in the corresponding repository and I have referenced it.
  • I have added tests to ensure my change is effective and works as intended.
  • New and existing tests are passing locally with my change.
  • I have performed self-review and corrected misspellings.

Additional for Feature type of change

  • Enhancement / new feature was discussed in a corresponding GitHub issue and Acceptance Criteria were created.

Copy all headers set on a StreamResource to VaadinResponse before
writing contents.

Fixes #203
Resource URL from MimeResponse can be either an absolute (e.g. in Liferay) or
a relative URL.
For absolute URLs, PortletStreamResourceRegistry does not need to alter URL
after resourceID is set.
@vaadin-bot
Copy link

SonarQube analysis reported 2 issues

  1. MAJOR PortletStreamResourceHandler.java#L66: Either log or rethrow this exception. rule
  2. MAJOR PortletStreamResourceRegistry.java#L110: Define and throw a dedicated exception instead of using a generic one. rule

Copy link
Contributor

@mshabarov mshabarov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with Liferay 7. Works perfectly.

@mshabarov mshabarov merged commit b7d0609 into master Mar 8, 2022
@mshabarov mshabarov deleted the issue/203_download_filename branch March 8, 2022 12:57
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 this pull request may close these issues.

Downloaded filename is not respected
3 participants