Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Flags not passed to curl #15

Closed
eproxus opened this Issue · 6 comments

2 participants

@eproxus

It seems that the flags are not passed to curl correctly. They are ignored:

$ resty http://localhost:8000                                    
http://localhost:8000*
$ GET /Blah
<?xml version="1.0"?><data>...</data>
$ GET /vehicle/ybinfo -H "Accept: application/json"
<?xml version="1.0"?><data>...</data>

Compared to curl:

$ curl http://localhost:8000/Blah
<?xml version="1.0"?><data>...</data>
$ curl http://localhost:8000/Blah -H "Accept: application/json"
{"data": ...} 

Using resty 1.3 under zsh 4.3.9 (i386-apple-darwin10.0) on OS X 10.6.6.

@micha
Owner

Hmm. Strange behavior. I'm not sure what to make of it. I did a little test here: micha/resty@fea541b

I get the following output in zsh:

micha@eels:resty% GET / -H asdf
curlopt[1] => '-H'
curlopt[1] == '-'
curlopt[2] => 'asdf'
curlopt[2] == 'a'
curlopt[@] == '-asdf'

Expected output (in bash it seems to work fine):

micha@eels:resty (test)$ GET / -H asdf
curlopt[1] => '-H'
curlopt[1] == '-H'
curlopt[2] => 'asdf'
curlopt[2] == 'asdf'
curlopt[@] == ' -H asdf'

Do you have any idea what could cause this?

@micha
Owner

I think zsh is splitting "$i" on characters for some reason, or something. Very weird behavior.

@eproxus

I can confirm the same behaviour on my setup:

$ GET / -H asdf 
curlopt[1] => '-H'
curlopt[1] == '-'
curlopt[2] => 'asdf'
curlopt[2] == 'a'
curlopt[@] == '-asdf'

My zsh-fu ends here, though.

@micha
Owner

Okay, I think we got it now. Version 1.4 has the fix.

@eproxus

Yup, that works! Thanks a bunch!

@micha
Owner

Excellent, I will close this issue.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.