code.gitea.io/gitea@v1.22.3/modules/web/middleware/request.go (about) 1 // Copyright 2020 The Gitea Authors. All rights reserved. 2 // SPDX-License-Identifier: MIT 3 4 package middleware 5 6 import ( 7 "net/http" 8 "strings" 9 ) 10 11 // IsAPIPath returns true if the specified URL is an API path 12 func IsAPIPath(req *http.Request) bool { 13 return strings.HasPrefix(req.URL.Path, "/api/") 14 }