Skip to content

[GEOS-11148] Update response headers for the Resources REST API #7161

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

Merged
merged 1 commit into from
Oct 6, 2023

Conversation

sikeoka
Copy link
Contributor

@sikeoka sikeoka commented Oct 6, 2023

GEOS-11148 Powered by Pull Request Badge

This PR sets the "Content-Disposition: attachment" response header when getting files from the Resources REST API which mitigates a security issue and also fixes a bug where web browsers often download files as "f.txt". The file's Content-Type is now determined from the servlet context which seems to be more robust than the URLConnection methods and is also more controllable by the server administrator.

Note that with this PR and #7162, the Classpath/File/Style Publisher and Resources REST API will always return the same Content-Type for a particular resource.

Checklist

For core and extension modules:

  • New unit tests have been added covering the changes.
  • Documentation has been updated (if change is visible to end users).
  • The REST API docs have been updated (when changing configuration objects or the REST controllers).
  • There is an issue in the GeoServer Jira (except for changes that do not affect administrators or end users in any way).
  • Commit message(s) must be in the form [GEOS-XYZWV] Title of the Jira ticket.
  • Bug fixes and small new features are presented as a single commit.
  • Each commit has a single objective (if there are multiple commits, each has a separate JIRA ticket describing its goal).

@jodygarnett jodygarnett merged commit 619658c into geoserver:main Oct 6, 2023
@jodygarnett jodygarnett added backport 2.23.x Instructs the bot to create a 2.23.x backport PR on merge backport 2.24.x Instructs the bot to create a 2.24.x backport PR on merge labels Oct 6, 2023
@sikeoka sikeoka deleted the GEOS-11148 branch October 10, 2023 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.23.x Instructs the bot to create a 2.23.x backport PR on merge backport 2.24.x Instructs the bot to create a 2.24.x backport PR on merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants