Skip to content

Commit 3053f67

Browse files
authored
Merge pull request #6 from ara-framework/fix/config
Update config.go
2 parents cba58ea + beff434 commit 3053f67

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

config/config.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ func LoadEnv() {
3737
// ReadConfigFile should initialize once jsonConfig
3838
func ReadConfigFile() {
3939
// logger should stop execution if there is no file found
40-
e, err := ioutil.ReadFile("config/" + os.Getenv("CONFIG_FILE"))
40+
e, err := ioutil.ReadFile(os.Getenv("CONFIG_FILE"))
4141
logger.Error(err, "Config file not found")
4242

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

4646
}
4747

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

6969
func modifyResponse(r *http.Response) error {
7070
if !isValidHeader(r) {
71-
err := errors.New("Unexpected Content-Type")
72-
logger.Error(err)
73-
return err
71+
return nil
7472
}
73+
7574
html, err := ioutil.ReadAll(r.Body)
7675
if err != nil {
77-
logger.Error(err, "Body was not provided")
76+
logger.Error(err, "Malformed HTML in Content Body")
7877
return err
7978
}
8079

0 commit comments

Comments
 (0)