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

EF: Don't crash CLI when uncompressed request throws uncaught exception #5837

Merged
merged 2 commits into from
Jul 5, 2023

Conversation

Skn0tt
Copy link
Contributor

@Skn0tt Skn0tt commented Jul 5, 2023

🎉 Thanks for submitting a pull request! 🎉

Summary

Fixes https://github.com/netlify/pod-dev-foundations/issues/536


For us to review and ship your PR efficiently, please perform the following steps:

  • Open a bug/issue before writing your code 🧑‍💻. This ensures we can discuss the changes and get feedback from everyone that should be involved. If you`re fixing a typo or something that`s on fire 🔥 (e.g. incident related), you can skip this step.
  • Read the contribution guidelines 📖. This ensures your code follows our style guide and
    passes our tests.
  • Update or add tests (if any source code was changed or added) 🧪
  • Update or add documentation (if features were changed or added) 📝
  • Make sure the status checks below are successful ✅

A picture of a cute animal (not mandatory, but encouraged)

@Skn0tt Skn0tt requested a review from a team as a code owner July 5, 2023 08:18
@Skn0tt Skn0tt self-assigned this Jul 5, 2023
@github-actions
Copy link

github-actions bot commented Jul 5, 2023

📊 Benchmark results

Comparing with 7a9f1cd

  • Dependency count: 1,312 (no change)
  • Package size: 278 MB ⬇️ 0.00% decrease vs. 7a9f1cd

Copy link
Member

@eduardoboucas eduardoboucas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left just one question, but LGTM!

* @param {string | undefined} contentEncoding
* @returns {Promise<Buffer>}
*/
const decompressResponseBody = async function (body, contentEncoding = '') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this handle the case where content-encoding contains multiple values, like deflate, gzip?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It won't, but I don't think that case exists for uncaught exceptions. This code path only occurs when x-nf-uncaught-error is set. The content-encoding is added by Deno automatically: https://deno.land/manual@v1.20.1/runtime/http_server_apis#automatic-body-compression
I don't think they ever combine compressions, so not supporting multiple values should be fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants