goStatic icon indicating copy to clipboard operation
goStatic copied to clipboard

Multiple headers?

Open llech opened this issue 5 years ago • 3 comments

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).

llech avatar Nov 18 '19 10:11 llech

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 avatar Nov 18 '19 13:11 PierreZ

@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?

kamil-kielczewski avatar Jun 11 '20 11:06 kamil-kielczewski

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

PierreZ avatar Jun 11 '20 13:06 PierreZ