A golang webfinger server implementation
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

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