From 11ee6f716c91e9ca830a8506825026a1ac8f63ba Mon Sep 17 00:00:00 2001 From: dylanhitt Date: Fri, 19 Apr 2024 21:52:10 -0400 Subject: [PATCH] docs: fix docs around WithCorsMiddleware --- documentation/docs/guides/options.md | 4 ++-- options.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/documentation/docs/guides/options.md b/documentation/docs/guides/options.md index 33b7dda9..56031c6f 100644 --- a/documentation/docs/guides/options.md +++ b/documentation/docs/guides/options.md @@ -58,8 +58,8 @@ import "github.com/rs/cors" s := fuego.NewServer( fuego.WithCorsMiddleware(cors.New(cors.Options{ - AllowOrigins: []string{"*"}, - AllowMethods: []string{"GET", "POST", "PUT", "DELETE"}, + AllowedOrigins: []string{"*"}, + AllowedMethods: []string{"GET", "POST", "PUT", "DELETE"}, }).Handler), ) ``` diff --git a/options.go b/options.go index 864ac3a0..f6d43c18 100644 --- a/options.go +++ b/options.go @@ -162,7 +162,7 @@ func WithTemplateFS(fs fs.FS) func(*Server) { // AllowedMethods: []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"}, // AllowedHeaders: []string{"*"}, // AllowCredentials: true, -// })) +// }).Handler) // ) func WithCorsMiddleware(corsMiddleware func(http.Handler) http.Handler) func(*Server) { return func(c *Server) { c.corsMiddleware = corsMiddleware }