func (p *politeiawww) handleVersion(w http.ResponseWriter, r *http.Request) {
	log.Tracef("handleVersion")

	versionReply, err := json.Marshal(v1.VersionReply{
		Version: v1.PoliteiaWWWAPIVersion,
		Route:   v1.PoliteiaWWWAPIRoute,
		PubKey:  hex.EncodeToString(p.cfg.Identity.Key[:]),
		TestNet: p.cfg.TestNet,
	})
	if err != nil {
		RespondWithError(w, r, 0, "handleVersion: Marshal %v", err)
		return
	}

	w.Header().Set("Content-Type", "application/json")
	w.Header().Add("Strict-Transport-Security",
		"max-age=63072000; includeSubDomains")
	if !p.cfg.Proxy {
		w.Header().Set(v1.CsrfToken, csrf.Token(r))
	}
	w.WriteHeader(http.StatusOK)
	w.Write(versionReply)
}
// version is an HTTP GET to determine what version and API route this backend
// is using.  Additionally it is used to obtain a CSRF token.
version is an HTTP GET to determine what version and API route this backend
is using.  Additionally it is used to obtain a CSRF token.
// version is an HTTP GET to determine what version and API route this backend // is using . Additionally it is used to obtain a CSRF token .
func (p *politeiawww) handleVersion(w http.ResponseWriter, r *http.Request) {
	log.Tracef("handleVersion")
	versionReply, err := json.Marshal(v1.VersionReply{
		Version: v1.PoliteiaWWWAPIVersion,
		Route:   v1.PoliteiaWWWAPIRoute,
		PubKey:  hex.EncodeToString(p.cfg.Identity.Key[:]),
		TestNet: p.cfg.TestNet,
	})
	if err != nil {
		RespondWithError(w, r, 0, "handleVersion: Marshal %v", err)
		return
	}
	w.Header().Set("Content-Type", "application/json")
	w.Header().Add("Strict-Transport-Security",
		"max-age=63072000; includeSubDomains")
	if !p.cfg.Proxy {
		w.Header().Set(v1.CsrfToken, csrf.Token(r))
	}
	w.WriteHeader(http.StatusOK)
	w.Write(versionReply)
}
func ( p * politeiawww ) handleVersion ( w http . ResponseWriter , r * http . Request ) { log . Tracef ( " " ) versionReply , err := json . Marshal ( v1 . VersionReply { Version : v1 . PoliteiaWWWAPIVersion , Route : v1 . PoliteiaWWWAPIRoute , PubKey : hex . EncodeToString ( p . cfg . Identity . Key [ : ] ) , TestNet : p . cfg . TestNet , } ) if err != nil { RespondWithError ( w , r , 0 , " " , err ) return } w . Header ( ) . Set ( " " , " " ) w . Header ( ) . Add ( " " , " " ) if ! p . cfg . Proxy { w . Header ( ) . Set ( v1 . CsrfToken , csrf . Token ( r ) ) } w . WriteHeader ( http . StatusOK ) w . Write ( versionReply ) }
version is an HTTP GET to determine what version and API route this backend
is using.
version is an HTTP GET to determine what version and API route this backend is using .