Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update encoding and headers #65

Merged
merged 3 commits into from
Jun 9, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,22 @@ If your payload exceeds this size, you will need to split it into pieces:

<https://github.com/newrelic/aws-log-ingestion/blob/1430a247f1fb5feb844f0707838a6ef48d21fc41/src/function.py#L292-L306>

The payload should be gzipped before sending:
The payload should be utf-8 encoded and then gzipped before sending:

<https://github.com/newrelic/aws-log-ingestion/blob/1430a247f1fb5feb844f0707838a6ef48d21fc41/src/function.py#L298>

The following GNU coreutils Bash command will reproduce the desired payload encoding and compression:

```sh
xclip -sel clip -o | iconv -cf utf-8 | gzip > payload.gz
```

Required headers include:

* <https://github.com/newrelic/aws-log-ingestion/blob/1430a247f1fb5feb844f0707838a6ef48d21fc41/src/function.py#L360-L361>
* `Content-Length`
* `Host`
* `Accept-Encoding: gzip`
* `Content-Length: <calculated when request is sent>`
* `Host: <calculated when request is sent>`

The payload should include the following (properly escaped) elements[^1]:

Expand Down