Skip to content

Instantly share code, notes, and snippets.

View sgarcez's full-sized avatar
🌀

Sergio Garcez sgarcez

🌀
View GitHub Profile
x-amazon-apigateway-integration:
#...
responses:
".*\\\"code\\\":\\\"[A-Z_]+_NOT_FOUND\\\".*":
statusCode: "404"
responseParameters:
method.response.header.Content-Type : "'application/json'"
responseTemplates:
application/json: |
#set ($errorMessageObj = $util.parseJson($input.path('$.errorMessage')))
x-amazon-apigateway-gateway-responses:
DEFAULT_4XX:
defaultResponse: false
responseParameters:
gatewayresponse.header.Content-Type: "'application/json'"
responseTemplates:
application/json: |
{
"code": "$context.error.responseType",
"message": $context.error.messageString
{
"code": "TASK_NOT_FOUND",
"public_message": "Task not found",
"private_message": "unknown task: foo-bar"
}
res, err := internal.SamInvoke("../../cloudformation.yaml", "AddTask", `{"note": "foo"}`)

Keybase proof

I hereby claim:

  • I am sgarcez on github.
  • I am sgarcez (https://keybase.io/sgarcez) on keybase.
  • I have a public key ASBIW3PYnxZsuL64I77wEN9eV9_4wnpOo7pquvJXPIKY6Ao

To claim this, I am signing this object:

@sgarcez
sgarcez / README.md
Last active January 7, 2022 10:52
Patron Compression Middlware Content-Length Issue

Patron Compression Middlware Content-Length Issue

Run test server

$ go run main.go

Before fix