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

feat: remove the need for content-length #22

Merged
merged 2 commits into from
Dec 10, 2020
Merged

feat: remove the need for content-length #22

merged 2 commits into from
Dec 10, 2020

Conversation

maraisr
Copy link
Member

@maraisr maraisr commented Nov 25, 2020

From the graphql/graphql-over-http#152 we no longer need content-length things. This PR aims to parse till a boundary, and yield then.

cc @robrichard

acao pushed a commit to graphql/express-graphql that referenced this pull request Dec 2, 2020
This removes the need for `Content-Length`, and handles the boundaries such that the next boundary is flushed as soon as possible.

References:
- graphql/graphql-over-http#152
- fmg relay-tools/fetch-multipart-graphql#22
- [meros](https://github.com/maraisr/meros)
this.chunkBuffer = '';
this.isPreamble = true;

Choose a reason for hiding this comment

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

can you explain what is and the importance of the isPreamble?

Copy link
Member Author

Choose a reason for hiding this comment

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

Everything before the first boundary should be ignored. So this just tracks that we've passed the first boundary. Another way could have been to increment a number, and simply not yield if less than 1.

robrichard pushed a commit to graphql/express-graphql that referenced this pull request Dec 3, 2020
This removes the need for `Content-Length`, and handles the boundaries such that the next boundary is flushed as soon as possible.

References:
- graphql/graphql-over-http#152
- fmg relay-tools/fetch-multipart-graphql#22
- [meros](https://github.com/maraisr/meros)
@robrichard robrichard merged commit 6de3715 into relay-tools:master Dec 10, 2020
@maraisr maraisr deleted the clength-edits branch December 10, 2020 04:22
robrichard pushed a commit to graphql/express-graphql that referenced this pull request Feb 9, 2021
This removes the need for `Content-Length`, and handles the boundaries such that the next boundary is flushed as soon as possible.

References:
- graphql/graphql-over-http#152
- fmg relay-tools/fetch-multipart-graphql#22
- [meros](https://github.com/maraisr/meros)
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.

3 participants