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 read chunks #291

Merged
merged 7 commits into from
Aug 27, 2023
Merged

Fix read chunks #291

merged 7 commits into from
Aug 27, 2023

Conversation

Ph0tonic
Copy link
Contributor

Hi,
This PR aims to fix #290.
I dug in the code to identify the cause of the problem and here is what I understood.

  1. WSGI is a Python Web Server Gateway Interface defined here: https://peps.python.org/pep-0333/
  2. When sending chunks the http specification defines how to encode content: https://datatracker.ietf.org/doc/html/rfc2616.html
  3. The web server implementing WSGI is responsible for handling and decoding HTTP packets to comply with wsgi.

The issue I identified in the code is that wsgidav add an extra layer of packet decoding above the wsgi layer used to run the server (cheroot, ...). wsgidav should not try to decode chunks as they are already decoded and normalised by the wsgi server.

I just changed the decoding for stream_data_chunked but we might also want to refactor stream_data.
@mar10 Let me know if you have any questions.

@mar10
Copy link
Owner

mar10 commented Jul 27, 2023

Hi, thanks for your contribution and sorry for the slow response.
Did you test you changes with different WebDAV clients?

@Ph0tonic
Copy link
Contributor Author

Hi, thanks for your contribution and sorry for the slow response. Did you test you changes with different WebDAV clients?

Hi, no problem. No, I only tested it with python requests library.

PS: By the way I believe that the issue #282 is linked with this one.

@Ph0tonic
Copy link
Contributor Author

Hi,
I tested the code with winscp and it worked.
I also simplified further the code.

@Ph0tonic
Copy link
Contributor Author

Hi,
Any update on this ?

@mar10
Copy link
Owner

mar10 commented Aug 24, 2023

The previous code addressed existing problems and was configurable with hotfixes.accept_put_without_content_length.
For example #10 and #282.

Before we can merge, we need to make sure that the change does not introduce a regression.
Als we need to test at least with these clients:

  • Windows 10/11 File Explorer
  • Windows 10/11 Folder mapping
  • macOS Finder
  • MS Office (e.g. Word)

If we decide to merge, we also need to remove the hot fix flag and add hotfixes.accept_put_without_content_length to _check_config() as deprecated field.

@Ph0tonic
Copy link
Contributor Author

Ph0tonic commented Aug 25, 2023

Ok thanks, so I tested it with a windows environment but I am not able to test it with macOS Finder.

  • Windows 10/11 File Explorer
  • Windows 10/11 Folder mapping
  • macOS Finder
  • MS Office (e.g. Word)

I also added the field to the deprecated list.

@mar10 mar10 merged commit dd3e53a into mar10:master Aug 27, 2023
4 checks passed
@mar10
Copy link
Owner

mar10 commented Aug 27, 2023

Smoke test with Finder on macOS Ventura passed as well, thank you!

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.

Unable to upload chunked big file using requests python library.
2 participants