You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

request.go 300B

1234567891011121314
  1. // Copyright 2020 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package middleware
  4. import (
  5. "net/http"
  6. "strings"
  7. )
  8. // IsAPIPath returns true if the specified URL is an API path
  9. func IsAPIPath(req *http.Request) bool {
  10. return strings.HasPrefix(req.URL.Path, "/api/")
  11. }