Skip to content

Commit

Permalink
Merge pull request #6 from ara-framework/fix/config
Browse files Browse the repository at this point in the history
Update config.go
  • Loading branch information
marconi1992 authored Aug 16, 2019
2 parents cba58ea + beff434 commit 3053f67
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ func LoadEnv() {
// ReadConfigFile should initialize once jsonConfig
func ReadConfigFile() {
// logger should stop execution if there is no file found
e, err := ioutil.ReadFile("config/" + os.Getenv("CONFIG_FILE"))
e, err := ioutil.ReadFile(os.Getenv("CONFIG_FILE"))
logger.Error(err, "Config file not found")

err = json.Unmarshal(e, &jsonConfig)
logger.Fatal(err, "Unable to parse config.json")
logger.Fatal(err, "Unable to parse " + os.Getenv("CONFIG_FILE"))

}

Expand All @@ -68,13 +68,12 @@ func isValidHeader(r *http.Response) bool {

func modifyResponse(r *http.Response) error {
if !isValidHeader(r) {
err := errors.New("Unexpected Content-Type")
logger.Error(err)
return err
return nil
}

html, err := ioutil.ReadAll(r.Body)
if err != nil {
logger.Error(err, "Body was not provided")
logger.Error(err, "Malformed HTML in Content Body")
return err
}

Expand Down

0 comments on commit 3053f67

Please sign in to comment.