Przeglądaj źródła

test git via nvim

torabkheslat 4 lat temu
rodzic
commit
a39ef620a7
3 zmienionych plików z 5 dodań i 5 usunięć
  1. 3 3
      README.md
  2. 1 1
      handler.go
  3. 1 1
      ovirt.go

+ 3 - 3
README.md

@@ -2,13 +2,13 @@
 
 A template with the following features for internal projects of Sysbo-Team at ZiTel
 
-* JWT authentication mechanism
-* FreeIPA
+- JWT authentication mechanism
+- FreeIPA
 
 ## How to run
+
 openssl s_client -connect ipa.sf.faraborddi.dc:443 >/usr/local/share/ca-certificates/ipa.crt;update-ca-certificates
 
 `go build .`
 
 ./CMD IP PORT
-

+ 1 - 1
handler.go

@@ -244,8 +244,8 @@ func getUserInfo(token string, username string) userInfo {
 	req.Header.Add("Accept", "text/plain")
 	req.Header.Add("Cookie", token)
 	res, err := client.Do(req)
-	defer res.Body.Close()
 	body, err := ioutil.ReadAll(res.Body)
+	defer res.Body.Close()
 	//fmt.Println("Getting Data for Response: ", body)
 	user := userInfo{}
 	json.Unmarshal(body, &user)

+ 1 - 1
ovirt.go

@@ -45,8 +45,8 @@ func login(BA string) OvirtObject {
 	req.Header.Add("Authorization", BA)
 
 	res, err := client.Do(req)
-	defer res.Body.Close()
 	body, err := ioutil.ReadAll(res.Body)
+	defer res.Body.Close()
 	object := OvirtObject{}
 	err = json.Unmarshal(body, &object)
 	return object