refined-room-36507
03/14/2022, 10:10 PMcurl
, and called
curl -s <http://kratos:4434/identities/c8d98079-c6c0-49e1-a034-92fa2269724b>
Nicely returned my identity (created by following the quickstart). Then I edited the JSON and tried updating it. Only I forgot to copy the file first, so -d @file.json
just inserted an empty file. This caused Kratos to return an internal server errorcurl -v -X PUT <http://kratos:4434/identities/c8d98079-c6c0-49e1-a034-92fa2269724b> -H "Accept: application/json" -d @~/Downloads/david.json
Output:
Warning: Couldn't read data from file "~/Downloads/david.json", this makes an
Warning: empty POST.
* Trying 172.19.0.6...
* TCP_NODELAY set
* Connected to kratos (172.19.0.6) port 4434 (#0)
> PUT /identities/c8d98079-c6c0-49e1-a034-92fa2269724b HTTP/1.1
> Host: kratos:4434
> User-Agent: curl/7.52.1
> Accept: application/json
> Content-Length: 0
> Content-Type: application/x-www-form-urlencoded
>
< HTTP/1.1 500 Internal Server Error
< Content-Type: application/json
< Date: Mon, 14 Mar 2022 22:10:02 GMT
< Content-Length: 72
* HTTP error before end of send, stop sending
<
{"error":{"code":500,"status":"Internal Server Error","message":"EOF"}}
* Curl_http_done: called premature == 0
* Closing connection 0
I suspect kratos doesn't know how to handle an empty file.