goStatic
goStatic copied to clipboard
Multiple headers?
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).
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 :rocket:
@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?
Maybe we should automatically detect wasm file and add the right header directly, what do you think about this @kamil-kielczewski?