[ 
https://issues.apache.org/jira/browse/TS-4819?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Syeda Persia Aziz updated TS-4819:
----------------------------------
    Comment: was deleted

(was: ## Test program
import gevent
import socket
import requests
import os
from threading import Thread
import sys
bSTOP = False
def handleResponse(response,*args, **kwargs):
    print(response.status_code)

def gen():
    yield 'pforpersia,champaignurbana'.encode('utf-8')
    yield 'there'.encode('utf-8')

def txn_replay():
    try:
        request_session = requests.Session()
        hostname = "127.0.0.1"
        port = "8080"
        request_session.proxies =  {"http": "http://{0}:{1}".format(hostname, 
port)}
        hdr = {'content-type': 'application/json', 'User-Agent': 'YMobile/1.0 
(com.yahoo.mobile.client.android.mail/5.7.1; Android/6.0.1; MMB29K; zenltetmo; 
samsung; SM-G928T; 5.0; 2560x1440;)'
, 'Content-MD5':'5f4308e950ab4d7188e96ddf740855ec', 'Content-Length':'20'}
        response = request_session.post('http://blabla.com/blabla', 
headers=hdr, stream=True, data=gen())
    except UnicodeEncodeError as e:
        print("UnicodeEncodeError exception")

    except requests.exceptions.ContentDecodingError as e:
        print("ContentDecodingError",e)
    except:
        e=sys.exc_info()
        print("ERROR in requests: ",e)

def main():
    txn_replay()

if __name__ == '__main__':
    main())

> ATS-6.2.x crashes if the message-body of a chunk is not correctly formatted
> ---------------------------------------------------------------------------
>
>                 Key: TS-4819
>                 URL: https://issues.apache.org/jira/browse/TS-4819
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: Core
>            Reporter: Syeda Persia Aziz
>
>  I found this when using the python "requests" library to generate HTTP 
> requests to test the ATS. The request method of this library generates 
> incorrect message body (i.e. does not follow the standard format) if both 
> Content-Length and chunked encoding are specified. ATS can handle requests 
> with these two fields being specified. It is the wrong format of the chunk 
> that makes the ATS crash. This problem can be reproduced using the python 
> file attached. If the Content-Length is  removed from the header, then the 
> library generates the correct format and ATS responds correctly. Ideally, 
> content-length and chunked encoding should not be specified together



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to