Commit 0908ab29 authored by owlo's avatar owlo

inventory and PC grabbing!

parent 8aaf2374
No preview for this file type
......@@ -483,6 +483,28 @@ func main() {
}
})
mux.HandleFunc("/examplePC", func(w http.ResponseWriter, req *http.Request) {
// Before any call to WriteHeader or Write, declare
// the trailers you will set during the HTTP
// response. These three headers are actually sent in
// the trailer.
if req.Header.Get("Accept") == "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\"" {
fmt.Println("Accept header is correct.")
w.Header().Set("Content-Type", "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\"")
//w.Header().Set("Authentication", signature)
w.WriteHeader(http.StatusOK)
fmt.Println("Signing test json.")
names, err := ioutil.ReadDir("tests/users/")
if err != nil {
fmt.Println("Error, user directory empty!")
}
signedContent := signer("tests/users/" + names[0].Name())
fmt.Println(string(signedContent))
fmt.Println("Signing complete.")
w.Write(signedContent)
}
})
mux.HandleFunc("/exampleactor", func(w http.ResponseWriter, req *http.Request) {
// Before any call to WriteHeader or Write, declare
// the trailers you will set during the HTTP
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment