Skip to content

Commit

Permalink
feat: return correct header
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentsenta committed May 16, 2023
1 parent 83307e4 commit adb4705
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ func (d *daemon) MustStart() {
}

func (d *daemon) runCheck(writer http.ResponseWriter, uristr string) error {
writer.Header().Add("Access-Control-Allow-Origin", "*")
writer.Header().Add("Content-Type", "application/json")

u, err := url.ParseRequestURI(uristr)
if err != nil {
return err
Expand Down Expand Up @@ -160,7 +163,6 @@ func (d *daemon) runCheck(writer http.ResponseWriter, uristr string) error {
return err
}

writer.Header().Add("Access-Control-Allow-Origin", "*")
_, err = writer.Write(outputData)
if err != nil {
fmt.Printf("could not return data over HTTP: %v\n", err.Error())
Expand Down

0 comments on commit adb4705

Please sign in to comment.