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. }