Mola-maker opened a new issue, #9078:
URL: https://github.com/apache/opendal/issues/9078

   ### OpenDAL version or commit
   
   main (f5ef36e), also v0.59.5
   
   ### Affected service or component
   
   integrations/dav-server (`dav-server-opendalfs`): `OpendalMetaData::etag`
   
   ### Describe the bug
   
   `OpendalMetaData` overrides `DavMetaData::etag` and returns `None` when the 
OpenDAL metadata has no ETag. Overriding it also turns off dav-server's default 
implementation (`dav-server 0.12`, `src/fs.rs`), which derives an ETag from the 
length and the modification time. As a result, a server backed by a service 
that does not report ETags, such as `services::Fs`, sends no ETag in any GET, 
HEAD, PUT or PROPFIND response. Clients cannot use `If-Match` or 
`If-None-Match` with a real tag, and they have no validator for caching.
   
   ### Steps to Reproduce
   
   Serve `services::Fs` with 
`DavHandler::builder().filesystem(OpendalFs::new(op))`:
   
   ```
   $ curl -s -X PUT --data hello http://127.0.0.1:18965/f.txt -D - | grep -i 
etag
   $ curl -sI http://127.0.0.1:18965/f.txt
   HTTP/1.1 200 OK
   last-modified: Wed, 25 Nov 2026 11:31:30 GMT
   $ curl -s -X PROPFIND -H "Depth: 0" http://127.0.0.1:18965/f.txt   # 
getlastmodified, no getetag
   ```
   
   OpenDAL's webdav behavior suite against that server 
(`OPENDAL_WEBDAV_DISABLE_DEPTH_INFINITY=true`) gives 130 passed and 13 failed. 
Eleven of the failures are `etag must exist` or `etag must be present`.
   
   ### Actual Behavior
   
   No ETag at all, even though `Last-Modified` is available.
   
   ### Expected Behavior
   
   When the backend has no ETag, fall back to dav-server's default ETag, which 
is derived from the length and the modification time.
   
   ### Additional Context
   
   If the backend's ETag is not a valid opaque tag, dropping it (the current 
behavior) is still reasonable.
   
   ### Reproduction confirmation
   
   - [x] I reproduced this issue against the affected component. For a 
service-specific report, I used the actual service rather than only a mock, 
emulator, or source-code analysis.
   
   ### Are you willing to submit a PR to fix this bug?
   
   - [x] Yes, I would like to submit a PR.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to