Quick fix for #1156 to distinct whether there's request body or not

@Kartones take a look at this fix and the following lines. request.body is checked at the first if but it was not used later unless there were no s3 keys. Do you think this is a safe change?