Skip to content
Snippets Groups Projects
Commit 9f490355 authored by Odin K. Henriksen's avatar Odin K. Henriksen
Browse files

Added documentation and commenting

parent 1c443370
No related branches found
No related tags found
No related merge requests found
...@@ -17,8 +17,7 @@ import ( ...@@ -17,8 +17,7 @@ import (
//API documentation can be found in: https://developers.google.com/safe-browsing/v4 //API documentation can be found in: https://developers.google.com/safe-browsing/v4
// Contacted API Endpoint : https://safebrowsing.googleapis.com/v4/threatMatches // Contacted API Endpoint : https://safebrowsing.googleapis.com/v4/threatMatches
func CallGoogleUrl(url string, response *utils.FrontendResponse2, wg *sync.WaitGroup) { func CallGoogleUrl(url string, response *utils.FrontendResponse2, wg *sync.WaitGroup) {
// Google API returnerer [] om den ikke kjenner til domenet / URL. Kan bruke dette til // Google API returns [] if it does not know the domain or URL. This is used to determine if it is malicious or not.
// å avgjøre om det er malicious eller ikke.
defer wg.Done() defer wg.Done()
var httpSearchURL, httpsSearchURL string var httpSearchURL, httpsSearchURL string
...@@ -95,6 +94,7 @@ func CallGoogleUrl(url string, response *utils.FrontendResponse2, wg *sync.WaitG ...@@ -95,6 +94,7 @@ func CallGoogleUrl(url string, response *utils.FrontendResponse2, wg *sync.WaitG
err = json.Unmarshal(body, &jsonResponse) err = json.Unmarshal(body, &jsonResponse)
if err != nil { if err != nil {
fmt.Println(err) fmt.Println(err)
logging.Logerror(err, "ERROR unmarshalling data to struct -Safebrowsing API.")
} }
utils.SetResponeObjectGoogle(jsonResponse, response) utils.SetResponeObjectGoogle(jsonResponse, response)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment