MCPcopy Index your code
hub / github.com/syncthing/syncthing / getJSMetadata

Method getJSMetadata

lib/api/api.go:698–706  ·  view source on GitHub ↗
(w http.ResponseWriter, _ *http.Request)

Source from the content-addressed store, hash-verified

696}
697
698func (s *service) getJSMetadata(w http.ResponseWriter, _ *http.Request) {
699 meta, _ := json.Marshal(map[string]interface{}{
700 "deviceID": s.id.String(),
701 "deviceIDShort": s.id.Short().String(),
702 "authenticated": true,
703 })
704 w.Header().Set("Content-Type", "application/javascript")
705 fmt.Fprintf(w, "var metadata = %s;\n", meta)
706}
707
708func (*service) getSystemVersion(w http.ResponseWriter, _ *http.Request) {
709 sendJSON(w, map[string]interface{}{

Callers

nothing calls this directly

Calls 5

MarshalMethod · 0.80
ShortMethod · 0.80
StringMethod · 0.65
SetMethod · 0.45
HeaderMethod · 0.45

Tested by

no test coverage detected