Flags not passed to curl #15

Closed
eproxus opened this Issue Mar 7, 2011 · 6 comments

Comments

Projects
None yet
2 participants
@eproxus

eproxus commented Mar 7, 2011

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

This comment has been minimized.

Show comment Hide comment
@micha

micha Mar 8, 2011

Owner

Hmm. Strange behavior. I'm not sure what to make of it. I did a little test here: 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?

Owner

micha commented Mar 8, 2011

Hmm. Strange behavior. I'm not sure what to make of it. I did a little test here: 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

This comment has been minimized.

Show comment Hide comment
@micha

micha Mar 8, 2011

Owner

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

Owner

micha commented Mar 8, 2011

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

@eproxus

This comment has been minimized.

Show comment Hide comment
@eproxus

eproxus Mar 8, 2011

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.

eproxus commented Mar 8, 2011

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

This comment has been minimized.

Show comment Hide comment
@micha

micha Mar 8, 2011

Owner

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

Owner

micha commented Mar 8, 2011

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

@eproxus

This comment has been minimized.

Show comment Hide comment
@eproxus

eproxus Mar 8, 2011

Yup, that works! Thanks a bunch!

eproxus commented Mar 8, 2011

Yup, that works! Thanks a bunch!

@micha

This comment has been minimized.

Show comment Hide comment
@micha

micha Mar 8, 2011

Owner

Excellent, I will close this issue.

Owner

micha commented Mar 8, 2011

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