A golang webfinger server implementation
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

22 行
541 B

  1. package webfinger
  2. import "net/http"
  3. // Middleware constant keys
  4. const (
  5. NoCacheMiddleware string = "NoCache"
  6. CorsMiddleware string = "Cors"
  7. ContentTypeMiddleware string = "Content-Type"
  8. )
  9. // noCache sets the headers to disable caching
  10. func noCache(w http.ResponseWriter, r *http.Request) {
  11. w.Header().Set("Cache-Control", "no-cache")
  12. w.Header().Set("Pragma", "no-cache")
  13. }
  14. // jrdSetup sets the content-type
  15. func jrdSetup(w http.ResponseWriter, r *http.Request) {
  16. w.Header().Set("Content-Type", "application/jrd+json")
  17. }