"Life is all about sharing. If we are good at something, pass it on." - Mary Berry

How to send an HTTP request without using curl?



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 | | POST     "/v1/endpoint"


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


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: