diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 0c0a1eb..26a5b39 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go-version: [ '1.20' ] + go-version: [ '1.24' ] steps: - uses: actions/checkout@v4 @@ -23,4 +23,4 @@ jobs: - name: Compile example code run: go build -o /tmp/executable.exe ./examples/simple - name: Compile example code - run: go build -o /tmp/executable.exe ./examples/standard \ No newline at end of file + run: go build -o /tmp/executable.exe ./examples/standard diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index f995cdc..fcb2e90 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go-version: [ '1.20' ] + go-version: [ '1.24' ] steps: - uses: actions/checkout@v4 diff --git a/go.mod b/go.mod index 420481a..755bc15 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/apourchet/httpwrap -go 1.22 +go 1.24 require ( github.com/gorilla/mux v1.7.2 diff --git a/standard.go b/standard.go index 196dcea..91d7852 100644 --- a/standard.go +++ b/standard.go @@ -66,7 +66,9 @@ func StandardResponseWriter() ResponseWriter { } w.WriteHeader(http.StatusOK) + w.Header().Set("Content-Type", "application/json") encoder := json.NewEncoder(w) + encoder.SetEscapeHTML(false) if sendError := encoder.Encode(res); sendError != nil { log.Println("Error writing response:", sendError) }