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

Multiple headers? #24

Open
llech opened this issue Nov 18, 2019 · 3 comments
Open

Multiple headers? #24

llech opened this issue Nov 18, 2019 · 3 comments

Comments

@llech
Copy link

llech commented Nov 18, 2019

Is it possible to set multiple http headers?

I've added to my deployment:

args: ['-append-header', 'Content-Type:application/json', '-append-header', 'Cache-Control:max-age=120']

but only the 2nd header was added (Cache-Control).

@PierreZ
Copy link
Owner

PierreZ commented Nov 18, 2019

Hello @llech !

You are right, the flag append-header is working on a single header. Do you want to contribute to goStatic? That would be a really nice feature 🚀

@kamil-kielczewski
Copy link

kamil-kielczewski commented Jun 11, 2020

@PierreZ I like your server - is very nice :) - However currently I need something likie this:
set arbitrary headers per arbitrary file (maybe Including support for wildcard pattern)

In my case I need to set "Content-Type: application/wasm" for all files *.wasm

I never write anything in GO but I cant try to do it - my proposition is to add following parameter

-append-file-headers path/to/file/with/wildcard*.wasm Content-Type:application/wasm,nextHeader:nextValue,...

(so first we put file path, then headers separated by comma)
(we should be able to add more than one -append-file-headers parameter)

@PierreZ what do you think about this?

@PierreZ
Copy link
Owner

PierreZ commented Jun 11, 2020

Maybe we should automatically detect wasm file and add the right header directly, what do you think about this @kamil-kielczewski?

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

No branches or pull requests

3 participants