[Tsung] Bug - inaccurate base string formation, affecting parameterized requests using oauth

Dragan Pelengič dragan.pelengic at beenius.tv
Fri Nov 15 09:27:44 CET 2013


There is an issue when doing parameterized requests using oauth.

My request looks like this:
http://192.168.11.151/restapi/rest/3/channels?channel_type=video&page=1

tsung.xml request formation:
<request>
                 <http 
url="/restapi/rest/3/channels?channel_type=video&page=1&page_size=1" 
method="GET" version="1.1" >
                        <oauth consumer_key="xxxx" 
consumer_secret="yyyy" method="HMAC-SHA1"/>
                 </http>
</request>


Relevant variables get the following values (in 
src/tsung/ts_http_common.erl):
ServerURL = http://192.168.11.151/restapi/rest/3/channels
URL = /restapi/rest/3/channels?channel_type=video&page=1

Which results in an inacurate base string formation and thus signature 
calculation. See below part of the signature base string for example:

GET&http%3A%2F%2F192.168.11.151%2Frestapi%2Frest%2F3%2Fchannels&%252Frestapi%252Frest%252F3%252Fchannels%253Fchannel_type%3Dvideo%26channel_type%3Dvideo%26oauth_consumer_key.........etc

I made a fix/workaround in my forked repo on github, but since im quite 
new to erlang im not sure how "clean" it is:
https://github.com/diarpi/tsung

Thought you should know!
BR,
D.


More information about the Tsung-users mailing list