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

1221 configurable static response headers #1233

Conversation

midhunkrishna
Copy link
Contributor

@midhunkrishna midhunkrishna commented Sep 30, 2020

Ability to configure response headers from .yml file
with the following configuration,

public_file_server:
  headers:
    "Cache-Control": "private, max-age=7200"

Description of the Change

When files are served by the static file server, via pipes/static.cr, and does not expose a way to modify the hard coded Cache-Control headers

Alternate Designs

This enhancement is similar to the static file middle-ware headers configuration of Rails. Original PR

Benefits

Ability to modify response headers for files served by static pipe.

Possible Drawbacks

Since this PR is an enhancement to the existing functionality, no changes are introduced to the behavior of the framework.

Abilty to configure response headers from <environment>.cr file
with the following configuration,
public_file_server:
  headers:
    "Cache-Control": "private, max-age=7200"
Update env/dev and env/production with public file server default
configurations
@midhunkrishna
Copy link
Contributor Author

@eliasjpr This should fix #1221 . Can you take a look and add your thoughts?

@drujensen drujensen requested a review from a team September 30, 2020 15:35
drujensen
drujensen previously approved these changes Sep 30, 2020
Copy link
Member

@drujensen drujensen left a comment

Choose a reason for hiding this comment

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

💯 Looks good. Thanks for the contribution. I have a small nit-picky naming concern.

spec/support/config/with_public_file_server.yml Outdated Show resolved Hide resolved
Modify configuration such that each pipe can be
independantly configured via settings
@eliasjpr eliasjpr merged commit af59a38 into amberframework:master Oct 4, 2020
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.

3 participants