mirror of
https://github.com/mudler/LocalAI.git
synced 2025-05-20 02:24:59 +00:00
feat: fiber CSRF (#2482)
new config option - enables or disables the fiber csrf middleware Signed-off-by: Dave Lee <dave@gray101.com>
This commit is contained in:
parent
2fc6fe806b
commit
4e1463fec2
5 changed files with 28 additions and 0 deletions
|
@ -26,6 +26,7 @@ type ApplicationConfig struct {
|
|||
DynamicConfigsDir string
|
||||
DynamicConfigsDirPollInterval time.Duration
|
||||
CORS bool
|
||||
CSRF bool
|
||||
PreloadJSONModels string
|
||||
PreloadModelsFromPath string
|
||||
CORSAllowOrigins string
|
||||
|
@ -87,6 +88,12 @@ func WithCors(b bool) AppOption {
|
|||
}
|
||||
}
|
||||
|
||||
func WithCsrf(b bool) AppOption {
|
||||
return func(o *ApplicationConfig) {
|
||||
o.CSRF = b
|
||||
}
|
||||
}
|
||||
|
||||
func WithModelLibraryURL(url string) AppOption {
|
||||
return func(o *ApplicationConfig) {
|
||||
o.ModelLibraryURL = url
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue