A golang webfinger server implementation
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.

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