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

fix(remix-architect,remix-netlify): fix typo in binaryTypes #4041

Merged
merged 4 commits into from
Sep 27, 2022
Merged

fix(remix-architect,remix-netlify): fix typo in binaryTypes #4041

merged 4 commits into from
Sep 27, 2022

Conversation

kamtugeza
Copy link
Contributor

Closes: #4040

That's a tiny typo in the remix-architect/binaryTypes.ts at line 36. I suppose there should be two types audio/wav and audio/webm.

@changeset-bot
Copy link

changeset-bot bot commented Aug 22, 2022

⚠️ No Changeset found

Latest commit: 2efc787

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@remix-cla-bot
Copy link
Contributor

remix-cla-bot bot commented Aug 22, 2022

Hi @kamtugeza,

Welcome, and thank you for contributing to Remix!

Before we consider your pull request, we ask that you sign our Contributor License Agreement (CLA). We require this only once.

You may review the CLA and sign it by adding your name to contributors.yml.

Once the CLA is signed, the CLA Signed label will be added to the pull request.

If you have already signed the CLA and received this response in error, or if you have any questions, please contact us at hello@remix.run.

Thanks!

- The Remix team

@remix-cla-bot
Copy link
Contributor

remix-cla-bot bot commented Aug 22, 2022

Thank you for signing the Contributor License Agreement. Let's get this merged! 🥳

@kamtugeza
Copy link
Contributor Author

kamtugeza commented Aug 22, 2022

I'm not sure should that goes to the discussion section or that could be done here, but I've compared types from that file with types from mime-types (thanks to @wingleung for his note in his fork of Remix Architect). The library has all needed types except:

  • audio/x-midi
  • application/x-gzip
  • application/x-java-archive
  • application/x-zip

I've not found reliable info about those types. I'm not sure if they are valid, and it seems okay to check binary types by the mime-types library instead of the custom method. What do you think about that?

@MichaelDeBoey MichaelDeBoey changed the title fix: separate two binary types which were concatenated fix(remix-architect): fix binaryTypes Aug 24, 2022
@MichaelDeBoey MichaelDeBoey requested a review from machour August 24, 2022 22:53
@mcansh
Copy link
Collaborator

mcansh commented Aug 24, 2022

I'm not sure should that goes to the discussion section or that could be done here, but I've compared types from that file with types from mime-types (thanks to @wingleung for his note in his fork of Remix Architect). The library has all needed types except:

  • audio/x-midi

  • application/x-gzip

  • application/x-java-archive

  • application/x-zip

I've not found reliable info about those types. I'm not sure if they are valid, and it seems okay to check binary types by the mime-types library instead of the custom method. What do you think about that?

this list started as a form of the list that architect keeps, but i'm down to looking into using mime-types if we can

@wingleung
Copy link

I'm not sure should that goes to the discussion section or that could be done here, but I've compared types from that file with types from mime-types (thanks to @wingleung for his note in his fork of Remix Architect). The library has all needed types except:

  • audio/x-midi
  • application/x-gzip
  • application/x-java-archive
  • application/x-zip

I've not found reliable info about those types. I'm not sure if they are valid, and it seems okay to check binary types by the mime-types library instead of the custom method. What do you think about that?

@kamtugeza 👍 yes, I wrote a todo about it because I couldn't find a isBinaryMimeType() kind of helper in that library. I had a closer look now and I see the library is more of a tool to figure out mime-types instead of identifying if the mime-type is binary or not.

I see now in the AWS docs that ALB and both api gateway versions already pass a property called isBase64Encoded so I think, for the aws integration, we should use that property instead.

And for the other adapters like netlify, we need to check if they have a similar property to this.

@MichaelDeBoey MichaelDeBoey changed the title fix(remix-architect): fix binaryTypes fix(remix-architect,remix-netlify): fix binaryTypes Aug 25, 2022
@kamtugeza
Copy link
Contributor Author

kamtugeza commented Aug 25, 2022

Here is my silly question: do we have a situation where we should have an empty body, and a response should be "binary"? 🙃

I ask that because we check a response encoding by the Content-Type header and if it's related to something that could be a stream we pass nodeResponse.body property into the readableStreamToString method where we expect body is ReadableStream<Uint8Array> and we don’t perform here any type checks or transformation (e.g. string to stream).

So why don’t we do a simple check, does the nodeResponse.body has an instance of ReadableStream instead of checking the header?

@machour machour linked an issue Sep 3, 2022 that may be closed by this pull request
@mcansh mcansh changed the title fix(remix-architect,remix-netlify): fix binaryTypes fix(remix-architect,remix-netlify): fix typo in binaryTypes Sep 27, 2022
@mcansh mcansh merged commit b1b3759 into remix-run:dev Sep 27, 2022
@MichaelDeBoey MichaelDeBoey added the awaiting release This issue has been fixed and will be released soon label Sep 27, 2022
@github-actions
Copy link
Contributor

🤖 Hello there,

We just published version v0.0.0-nightly-b1b3759-20220928 which includes this pull request. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

mcansh added a commit that referenced this pull request Sep 28, 2022
mcansh added a commit that referenced this pull request Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting release This issue has been fixed and will be released soon CLA Signed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug]: architect binary types typo
4 participants