2018-12-24 17:45:15 +00:00
|
|
|
/*
|
2022-11-11 04:49:16 +00:00
|
|
|
* Copyright © 2018-2019 Musing Studio LLC.
|
2018-12-24 17:45:15 +00:00
|
|
|
*
|
|
|
|
* This file is part of WriteFreely.
|
|
|
|
*
|
|
|
|
* WriteFreely is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Affero General Public License, included
|
|
|
|
* in the LICENSE file in this source code package.
|
|
|
|
*/
|
2018-12-31 06:05:26 +00:00
|
|
|
|
2018-11-08 06:28:08 +00:00
|
|
|
package writefreely
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"net/http"
|
|
|
|
)
|
|
|
|
|
2019-05-12 20:55:30 +00:00
|
|
|
func handleViewHostMeta(app *App, w http.ResponseWriter, r *http.Request) error {
|
2018-11-08 06:28:08 +00:00
|
|
|
w.Header().Set("Server", serverSoftware)
|
|
|
|
w.Header().Set("Content-Type", "application/xrd+xml; charset=utf-8")
|
|
|
|
|
|
|
|
meta := `<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0">
|
|
|
|
<Link rel="lrdd" type="application/xrd+xml" template="https://` + r.Host + `/.well-known/webfinger?resource={uri}"/>
|
|
|
|
</XRD>`
|
|
|
|
fmt.Fprintf(w, meta)
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|