A clean, Markdown-based publishing platform made for writers. Write together, and build a community. https://writefreely.org
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.
 
 
 
 
 

20 lines
516 B

  1. package writefreely
  2. import (
  3. "fmt"
  4. "net/http"
  5. )
  6. func handleViewHostMeta(app *app, w http.ResponseWriter, r *http.Request) error {
  7. w.Header().Set("Server", serverSoftware)
  8. w.Header().Set("Content-Type", "application/xrd+xml; charset=utf-8")
  9. meta := `<?xml version="1.0" encoding="UTF-8"?>
  10. <XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0">
  11. <Link rel="lrdd" type="application/xrd+xml" template="https://` + r.Host + `/.well-known/webfinger?resource={uri}"/>
  12. </XRD>`
  13. fmt.Fprintf(w, meta)
  14. return nil
  15. }