Skip to content

Commit 150f9b6

Browse files
handle well known endpoints (#9)
1 parent 24a9a10 commit 150f9b6

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

main.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"os"
66
"path/filepath"
77
"regexp"
8+
"strings"
89

910
"gofr.dev/pkg/gofr"
1011
)
@@ -19,8 +20,14 @@ func main() {
1920

2021
staticFilePath := app.Config.GetOrDefault("STATIC_DIR_PATH", defaultStaticFilePath)
2122

22-
app.UseMiddleware(func(_ http.Handler) http.Handler {
23+
app.UseMiddleware(func(h http.Handler) http.Handler {
2324
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
25+
if strings.Contains(r.URL.Path, "/.well-known/") {
26+
h.ServeHTTP(w, r)
27+
28+
return
29+
}
30+
2431
filePath := filepath.Join(staticFilePath, r.URL.Path)
2532

2633
// check if the path has a file extension

0 commit comments

Comments
 (0)