<!-- Love localstack? Please consider supporting our collective:
👉  https://opencollective.com/localstack/donate -->

I'm using localstack as of commit f9dd152cbfab0a51e01e0c0b3ba7463304c8dba3

I ran in an issue where a file I first added to my S3 device (`PutObject()`) would come back out with one less byte. I verified what would be happening and where the error might be. The only possible location would be the localstack implementation (_unfortunately_).

My binary file ends with 0x0D. This is a `\r` character.

The system I use is [MinIO-Go](https://github.com/minio/minio-go) which sends a chunk-signature along the body of the file.  When that happens, it looks like you remove all `\r` and `\n` (in my test below I also added `\n` characters and they all get removed) instead of just one `\n` and then one `\r` (i.e. you're certain going backward for this exercise).

I can see that there is one 0x0D in my binary file and then the "\r\n" sequence just before the chunk-signature. You should only remove on "\r\n" and leave the rest alone.

Here is my go program to show the reproducible issue:

```
package main

import (
	"bytes"
	"fmt"
	"log"

	"github.com/minio/minio-go"
)

func main() {

        // all final 10 and 13 get removed from my data buffer!
	data := []byte{ 72, 101, 108, 108, 111, 10, 13, 10, 13, 10, 13, 10, 13 }
	//ioutil.WriteFile("/tmp/nolike.txt", data, 0644)

	mc, err := minio.New(
			"127.0.0.1:14572",	// localstack
			"foo",			// AWS access key id
			"bar",			// AWS secret access key
			false)
	if err != nil {
		log.Fatal("could not connect to S3", err)
	}

	err = mc.MakeBucket("bucket1", "us-east-1")
	if err != nil {
		exists, errBucketExists := mc.BucketExists("bucket1")
		hasBucket := errBucketExists == nil && exists
		if !hasBucket {
			log.Fatal("bucket1 does not exist and we could not create it", err, errBucketExists)
		}
	}

	fileReader := bytes.NewReader(data)
	size, err := mc.PutObject(
		"bucket1",
		"data",
		fileReader,
		int64(len(data)),
		minio.PutObjectOptions{
				ContentType: "audio/mpeg",
			})
	if err != nil {
		log.Fatal("PutObject failed.")
	}
	fmt.Println("size sent:", size)

	info, err := mc.StatObject("bucket1", "data", minio.StatObjectOptions{})
	if err != nil {
		log.Fatal("StatObject failed")
	}

	fmt.Println("info:", info)
	fmt.Println("info size:", info.Size, "(should be equal to", len(data), "if correct)")
}
```

At the end this program should print:

    info size: 13 (should be equal to 13 if correct)

But instead I get:

    info size: 7 (should be equal to 13 if correct)

because the `StatObject()` returns the correct size saved in S3, but not the expected size.

The exact set of bytes sent:

> 80 85 84 32 47 98 117 99 107 101 116 49 47 100 97 116 97 32 72 84 84 80 47 49 46 49 13 10 72 111 115 116 58 32 49 50 55 46 48 46 48 46 49 58 49 52 53 55 50 13 10 85 115 101 114 45 65 103 101 110 116 58 32 77 105 110 73 79 32 40 108 105 110 117 120 59 32 97 109 100 54 52 41 32 109 105 110 105 111 45 103 111 47 118 54 46 48 46 51 53 13 10 67 111 110 116 101 110 116 45 76 101 110 103 116 104 58 32 49 56 53 13 10 65 117 116 104 111 114 105 122 97 116 105 111 110 58 32 65 87 83 52 45 72 77 65 67 45 83 72 65 50 53 54 32 67 114 101 100 101 110 116 105 97 108 61 102 111 111 47 50 48 49 57 48 57 49 56 47 117 115 45 101 97 115 116 45 49 47 115 51 47 97 119 115 52 95 114 101 113 117 101 115 116 44 83 105 103 110 101 100 72 101 97 100 101 114 115 61 104 111 115 116 59 120 45 97 109 122 45 99 111 110 116 101 110 116 45 115 104 97 50 53 54 59 120 45 97 109 122 45 100 97 116 101 59 120 45 97 109 122 45 100 101 99 111 100 101 100 45 99 111 110 116 101 110 116 45 108 101 110 103 116 104 44 83 105 103 110 97 116 117 114 101 61 57 102 102 55 53 55 98 54 55 53 55 48 98 48 100 53 53 53 102 101 100 48 101 52 57 52 52 99 101 48 49 50 101 98 99 98 51 102 57 54 51 98 52 48 48 52 52 50 57 54 102 51 102 98 56 57 99 100 98 55 51 57 100 56 13 10 67 111 110 116 101 110 116 45 84 121 112 101 58 32 97 117 100 105 111 47 109 112 101 103 13 10 88 45 65 109 122 45 67 111 110 116 101 110 116 45 83 104 97 50 53 54 58 32 83 84 82 69 65 77 73 78 71 45 65 87 83 52 45 72 77 65 67 45 83 72 65 50 53 54 45 80 65 89 76 79 65 68 13 10 88 45 65 109 122 45 68 97 116 101 58 32 50 48 49 57 48 57 49 56 84 48 53 49 53 48 57 90 13 10 88 45 65 109 122 45 68 101 99 111 100 101 100 45 67 111 110 116 101 110 116 45 76 101 110 103 116 104 58 32 49 51 13 10 13 10 100 59 99 104 117 110 107 45 115 105 103 110 97 116 117 114 101 61 97 102 53 101 54 99 48 97 54 57 56 98 48 49 57 50 101 57 97 97 53 100 57 48 56 51 53 53 51 100 52 100 50 52 49 100 56 49 102 54 57 101 99 54 50 98 49 56 52 100 48 53 99 53 48 57 97 100 53 49 54 54 97 102 13 10 72 101 108 108 111 32 32 10 13 10 13 10 13 13 10 48 59 99 104 117 110 107 45 115 105 103 110 97 116 117 114 101 61 102 50 97 53 48 97 56 99 48 97 100 52 100 50 49 50 98 53 55 57 99 50 52 56 57 99 54 100 49 50 50 100 98 56 56 100 56 97 48 100 48 98 57 56 55 101 97 49 102 51 101 57 100 48 56 49 48 55 52 97 53 57 51 55 13 10 13 10

As we can see, near the end, there is a sequence of "10 13 ..." and then on "13 10" before the "48 59 99 ..." which is the _chunk-signature_:

`0;chunk-signature=f2a50a8c0ad4d212b579c2489c6d122db88d8a0d0b987ea1f3e9d081074a5937\r\n\r\n`

The bytes represent the following header and body (easier to read, but you may miss some bytes trying to just use that ASCII code):

```
PUT /bucket1/data HTTP/1.1
Host: 127.0.0.1:14572
User-Agent: MinIO (linux; amd64) minio-go/v6.0.35
Content-Length: 185
Authorization: AWS4-HMAC-SHA256 Credential=foo/20190918/us-east-1/s3/aws4_request,SignedHeaders=host;x-amz-content-sha256;x-amz-date;x-amz-decoded-content-length,Signature=9ff757b67570b0d555fed0e4944ce012ebcb3f963b40044296f3fb89cdb739d8
Content-Type: audio/mpeg
X-Amz-Content-Sha256: STREAMING-AWS4-HMAC-SHA256-PAYLOAD
X-Amz-Date: 20190918T051509Z
X-Amz-Decoded-Content-Length: 13

d;chunk-signature=af5e6c0a698b0192e9aa5d9083553d4d241d81f69ec62b184d05c509ad5166af
Hello  



0;chunk-signature=f2a50a8c0ad4d212b579c2489c6d122db88d8a0d0b987ea1f3e9d081074a5937

```
if is_in_docker and LOCALSTACK_HOSTNAME == DOCKER_BRIDGE_IP:
        LOCALSTACK_HOSTNAME = DOCKER_HOST_FROM_CONTAINER
except socket.error:
    pass
if is_in_docker and not os.environ.get('LAMBDA_REMOTE_DOCKER', '').strip():
    LAMBDA_REMOTE_DOCKER = True
if not is_in_docker and 'docker' in LAMBDA_EXECUTOR and not is_linux():
    print(('!WARNING! - Running outside of Docker with LAMBDA_EXECUTOR=%s can lead to '
           'problems on your OS. The environment variable $LOCALSTACK_HOSTNAME may not '
           'be properly set in your Lambdas.') % LAMBDA_EXECUTOR)
CONFIG_FILE_PATH = os.path.join(expanduser('~'), '.localstack')
for folder in [DATA_DIR, TMP_FOLDER]:
    if folder and not os.path.exists(folder):
        try:
            os.makedirs(folder)
        except Exception:
            
            
            pass
no_proxy = ','.join(set((LOCALSTACK_HOSTNAME, HOSTNAME, LOCALHOST, '127.0.0.1', '[::1]')))
if os.environ.get('no_proxy'):
    os.environ['no_proxy'] += ',' + no_proxy
elif os.environ.get('NO_PROXY'):
    os.environ['NO_PROXY'] += ',' + no_proxy
else:
    os.environ['no_proxy'] = no_proxy
CLI_COMMANDS = {}
VALID_REGIONS = set(Session().get_available_regions('sns'))
def parse_service_ports():