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

Sniff Content-Encoding, don't require Content-Type #7686

Merged
merged 5 commits into from
Mar 29, 2022
Merged

Conversation

axw
Copy link
Member

@axw axw commented Mar 29, 2022

Motivation/summary

  • Don't require the Content-Type header for /intake; assume application/x-ndjson if not specified.
  • Sniff Content-Encoding from the request body if the header is not specified

Checklist

How to test these changes

Send a variety of requests to APM Server, checking that they are all accepted:

  • Content-Encoding unspecified, uncompressed body
  • Content-Encoding unspecified, gzip-compressed body
  • Content-Encoding unspecified, deflate-compressed body
  • Content-Encoding: gzip, gzip-compressed body
  • Content-Encoding: deflate, deflate-compressed body
  • Content-Type unspecified
  • Content-Type: application/x-ndjson

Check that these requests are rejected:

  • Content-Type: invalid
  • Content-Encoding: invalid

Related issues

Closes #7271

@mergify
Copy link
Contributor

mergify bot commented Mar 29, 2022

This pull request does not have a backport label. Could you fix it @axw? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-7.x is the label to automatically backport to the 7.x branch.
  • backport-7./d is the label to automatically backport to the 7./d branch. /d is the digit

NOTE: backport-skip has been added to this pull request.

@mergify mergify bot added the backport-skip Skip notification from the automated backport with mergify label Mar 29, 2022
@apmmachine
Copy link
Collaborator

apmmachine commented Mar 29, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-03-29T08:38:11.376+0000

  • Duration: 27 min 0 sec

Test stats 🧪

Test Results
Failed 0
Passed 3953
Skipped 13
Total 3966

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /hey-apm : Run the hey-apm benchmark.

  • /package : Generate and publish the docker images.

  • /test windows : Build & tests on Windows.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@axw axw requested a review from a team March 29, 2022 07:29
@axw axw marked this pull request as ready for review March 29, 2022 07:29
@axw axw merged commit f9fa8a7 into elastic:main Mar 29, 2022
@axw axw deleted the beacon branch March 29, 2022 12:00
@kruskall kruskall added the backport-7.x Backport PR to the 7.x branch label Jul 11, 2023
@mergify mergify bot removed the backport-skip Skip notification from the automated backport with mergify label Jul 11, 2023
@kruskall kruskall added backport-skip Skip notification from the automated backport with mergify and removed backport-7.x Backport PR to the 7.x branch labels Jul 11, 2023
kruskall pushed a commit to kruskall/apm-server that referenced this pull request Jul 11, 2023
* decoder: sniff Content-Encoding

* api/intake: don't require Content-Type

* Update changelog
kruskall added a commit that referenced this pull request Jul 13, 2023
…7686) (#11185)

* Sniff Content-Encoding, don't require Content-Type (#7686)

* decoder: sniff Content-Encoding

* api/intake: don't require Content-Type

* Update changelog

* lint: remove usage of deprecated ioutil

---------

Co-authored-by: Andrew Wilkins <axw@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-skip Skip notification from the automated backport with mergify
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Do not require content-type and content-encoding in RUM requests
4 participants