micha / resty

Little command line REST client that you can use in pipelines (bash or zsh).
MIT License
2.65k stars 143 forks source link

Odd Behavior with '-v' Flag #43

Open robottaway opened 10 years ago

robottaway commented 10 years ago

I was having a bit of trouble this morning. Basically when I use the -v flag Resty won't respect the URL and other such things I pass in and instead will re-run the last command which did not include the flag. See below. Pretty unexpected behavior and seems contrary to the docs. Doesn't seem to me this would be useful considering many operations may not be idempotent.

Robs-MacBook-Pro:bin rob$ GET /easternhhc_test_t4/current_failures/_count
{"count":18,"_shards":{"total":5,"successful":5,"failed":0}}
Robs-MacBook-Pro:bin rob$ GET -v /easternhhc_test_t4/current_failures/_status
* <url> malformed
* <url> malformed
* <url> malformed
* About to connect() to ec2-174-129-47-132.compute-1.amazonaws.com port 443 (#0)
*   Trying 174.129.47.132...
* connected
* Connected to ec2-174-129-47-132.compute-1.amazonaws.com (174.129.47.132) port 443 (#0)
* SSLv3, TLS handshake, Client hello (1):
} [data not shown]
* SSLv3, TLS handshake, Server hello (2):
{ [data not shown]
* SSLv3, TLS handshake, CERT (11):
{ [data not shown]
* SSLv3, TLS handshake, Server key exchange (12):
{ [data not shown]
* SSLv3, TLS handshake, Server finished (14):
{ [data not shown]
* SSLv3, TLS handshake, Client key exchange (16):
} [data not shown]
* SSLv3, TLS change cipher, Client hello (1):
} [data not shown]
* SSLv3, TLS handshake, Finished (20):
} [data not shown]
* SSLv3, TLS change cipher, Client hello (1):
{ [data not shown]
* SSLv3, TLS handshake, Finished (20):
{ [data not shown]
* SSL connection using DHE-RSA-AES256-SHA
* Server certificate:
*    subject: C=US; ST=California; L=San Jose; O=DeVero; OU=Eng; CN=*.amazonaws.com
*    start date: 2013-08-08 22:58:30 GMT
*    expire date: 2014-08-08 22:58:30 GMT
*    common name: *.amazonaws.com (matched)
*    issuer: C=US; ST=California; L=San Jose; O=DeVero; OU=Eng; CN=*.amazonaws.com
*    SSL certificate verify result: self signed certificate (18), continuing anyway.
* Server auth using Basic with user 'dauser'
> GET /easternhhc_test_t4/current_failures/_count HTTP/1.1
> Authorization: Basic bWFtMcc3czNhbkMwbm1zcnk6ejB0YXBlckBzM3QwcmVtM21iM3I=
> User-Agent: curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8y zlib/1.2.5
> Host: ec2-174-129-47-132.compute-1.amazonaws.com
> Accept: */*
> 
< HTTP/1.1 200 OK
< Server: nginx/1.1.19
< Date: Wed, 22 Jan 2014 18:38:42 GMT
< Content-Type: application/json; charset=UTF-8
< Content-Length: 60
< Connection: keep-alive
< 
{ [data not shown]
* Connection #0 to host ec2-174-129-47-132.compute-1.amazonaws.com left intact
* Closing connection #0
* SSLv3, TLS alert, Client hello (1):
} [data not shown]
{"count":18,"_shards":{"total":5,"successful":5,"failed":0}}
micha commented 10 years ago

That is not good, looks like a bug. I will investigate. Thanks for opening the issue!