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.
 
 
 
 
 

30 lines
802 B

  1. /*
  2. * Copyright © 2018 A Bunch Tell LLC.
  3. *
  4. * This file is part of WriteFreely.
  5. *
  6. * WriteFreely is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU Affero General Public License, included
  8. * in the LICENSE file in this source code package.
  9. */
  10. package writefreely
  11. import (
  12. "fmt"
  13. "net/http"
  14. )
  15. func handleViewHostMeta(app *app, w http.ResponseWriter, r *http.Request) error {
  16. w.Header().Set("Server", serverSoftware)
  17. w.Header().Set("Content-Type", "application/xrd+xml; charset=utf-8")
  18. meta := `<?xml version="1.0" encoding="UTF-8"?>
  19. <XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0">
  20. <Link rel="lrdd" type="application/xrd+xml" template="https://` + r.Host + `/.well-known/webfinger?resource={uri}"/>
  21. </XRD>`
  22. fmt.Fprintf(w, meta)
  23. return nil
  24. }