From 5bab3cf753742fe34d8412c69ae15b1b4b20d7e0 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Mon, 20 Nov 2017 08:56:37 +0100 Subject: [PATCH] Added some comments --- bots/avatars/avatars.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bots/avatars/avatars.go b/bots/avatars/avatars.go index 8f27146a..db987a8c 100644 --- a/bots/avatars/avatars.go +++ b/bots/avatars/avatars.go @@ -42,9 +42,12 @@ func main() { log.Fatal(http.ListenAndServe(":"+port, nil)) } -// onRequest handles requests and refreshes the requested avatar +// onRequest handles requests and refreshes the requested avatar. func onRequest(w http.ResponseWriter, req *http.Request) { + // User ID is simply the path without the slash userID := strings.TrimPrefix(req.URL.Path, "/") + + // Get user from database user, err := arn.GetUser(userID) if err != nil {