added CORS support

This commit is contained in:
Łukasz Budnik
2021-02-16 12:59:42 +01:00
parent 988ee495ba
commit 7073bea751
2 changed files with 18 additions and 1 deletions

View File

@@ -32,8 +32,12 @@ func TestHandler(t *testing.T) {
var response response
json.Unmarshal(rr.Body.Bytes(), &response)
// test response
assert.Equal(t, 1, response.Counter)
assert.Equal(t, "example.org", response.Host)
assert.NotEmpty(t, response.EnvVariables)
assert.NotEmpty(t, response.Files[".gitignore"])
// test cors
assert.Contains(t, rr.HeaderMap["Access-Control-Allow-Origin"], "*")
}