Skip to content

Commit fc097dc

Browse files
authored
fix newline stripping for S3 chunked encoding (localstack#469)
1 parent 89acf29 commit fc097dc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

localstack/services/s3/s3_listener.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,10 @@ def strip_chunk_signatures(data):
249249
if data_new != data:
250250
# trim \r (13) or \n (10)
251251
for i in range(0, 2):
252-
if data_new[0] in (10, 13):
252+
if len(data_new) and data_new[0] in (10, 13):
253253
data_new = data_new[1:]
254254
for i in range(0, 6):
255-
if data_new[-1] in (10, 13):
255+
if len(data_new) and data_new[-1] in (10, 13):
256256
data_new = data_new[:-1]
257257
return data_new
258258

0 commit comments

Comments
 (0)