dart-archive / shelf_static

archived repo
https://github.com/dart-lang/shelf/tree/master/pkgs/shelf_static
BSD 3-Clause "New" or "Revised" License
24 stars 24 forks source link

Add option to Override Headers #71

Closed filipenanclarez closed 2 years ago

filipenanclarez commented 2 years ago

I need to set ACCESS_CONTROL_ALLOW_ORIGIN: '*' because i got erros when try load .ttf fonts with static server.

I try to do with shelf_cors_headers but without success.

Can you add option to override Headers? Or can i do this with another way? If exist please let me know.

kevmoo commented 2 years ago

You just need to wrap the static handler with middleware.

filipenanclarez commented 2 years ago

You just need to wrap the static handler with middleware.

Can show me a simple example? I try it, but not succes.