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: Let Representations always have a body #987

Merged
merged 1 commit into from Oct 12, 2021

Conversation

joachimvh
Copy link
Member

Closes #982 and indirectly closes #969 (since we now accept empty/missing bodies).

Operation.body is no longer optional. Representation has a new isEmpty parameter, which in practice is a shortcut for checking if there is a content-type.

I looked into having the data field of a Representation be optional, but the problem is that classes then no longer can be sure they get a data stream from functions that return a Representation. It would also potentially cause confusion between an empty data stream and an undefined one.

src/ldp/operations/PatchOperationHandler.ts Outdated Show resolved Hide resolved
src/ldp/operations/PostOperationHandler.ts Outdated Show resolved Hide resolved
src/ldp/operations/PutOperationHandler.ts Outdated Show resolved Hide resolved
src/ldp/representation/Representation.ts Outdated Show resolved Hide resolved
This is relevant when the request has a content-type
but no data.
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.

Support content-types without body Misleading error on requests without Content-Length header
2 participants