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(nextcloud)!: Require content-length for all WebDAV put requests #1987

Closed

Conversation

provokateurin
Copy link
Member

Some specific setups do not like it when the content-length header is not present. The consumer of the package should always know the size of the data they are trying to upload, so enforcing the content-length is no problem.
For reference: saber-notes/saber#945 saber-notes/saber#1232

Copy link

codecov bot commented Apr 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 28.85%. Comparing base (0b64d23) to head (49a679f).
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1987   +/-   ##
=======================================
  Coverage   28.85%   28.85%           
=======================================
  Files         249      249           
  Lines       84111    84111           
=======================================
  Hits        24269    24269           
  Misses      59842    59842           
Flag Coverage Δ *Carryforward flag
dynamite 30.81% <ø> (ø) Carriedforward from 0b64d23
dynamite_end_to_end_test 62.16% <ø> (ø) Carriedforward from 0b64d23
dynamite_runtime 82.65% <ø> (ø) Carriedforward from 0b64d23
neon_dashboard 92.56% <ø> (ø)
neon_framework 38.36% <ø> (ø)
neon_talk 96.67% <ø> (ø)
nextcloud 25.69% <100.00%> (ø)
sort_box 90.90% <ø> (ø) Carriedforward from 0b64d23

*This pull request uses carry forward flags. Click here to find out more.

Files Coverage Δ
packages/nextcloud/lib/src/webdav/client.dart 100.00% <100.00%> (ø)

Copy link
Member

@Leptopoda Leptopoda left a comment

Choose a reason for hiding this comment

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

This means another breaking release shortly?

@@ -146,23 +146,23 @@ class WebDavClient {
/// * [putStream] for a complete operation executing this request.
http.BaseRequest putStream_Request(
Stream<List<int>> localData,
int contentLength,
Copy link
Member

Choose a reason for hiding this comment

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

I'd like to leave this as a named parameter.

  1. easier to read code
  2. less breaking for our users

@provokateurin
Copy link
Member Author

I don't like having a breaking release because this doesn't fix anything that is actually broken. Maybe it makes more sense to add an assert or print a log to inform the developers they are probably making a mistake? I'm not sure what the best way is... I'd also be open to not merge this patch at all and just add some doc comments that explain why it is important to set the parameter 🤷‍♀️

@Leptopoda
Copy link
Member

I'm fine with either way.

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