How to send an HTTP request without using curl?
2022-05-22
Problem
We are using JWT validation. For some reasons, when testing on staging, we got 401 error:
1[GIN] 2022/05/20 - 14:20:57 | 401 | 2.588128ms | 127.0.0.1 | POST "/v1/endpoint"
Troubleshooting
After looking at the source code, we need to set the operation_debug to true to see what caused that error:
12022/05/20 08:31:26 KRAKEND ERROR: [ENDPOINT: /v1/endpoint][JWTValidator] Unable to validate the token: should have a JSON content type for JWKS endpoint
A && B || C is not the same as if-then-else
2020-12-26
I have been thought that if-then-else statement can be written in one line by using A && B || C
but I was wrong.
To speed up my Drone CI time, I configured the static-check step to only run when there are some .go
files have been changed:
1git --no-pager diff --name-only ${DRONE_COMMIT_LINK##*/} | grep -q "\.go$" && golangci-lint run --deadline 2m -v ./... || true
I was thought that A && B || C
is the same as: