Skip to content

fix: NPE and incorrect status on WebDAV HEAD for folders EXO-89265 - #2038

Merged
Jihed525 merged 1 commit into
patch/7.2.0from
patch-7.2.0-1
Aug 12, 2026
Merged

fix: NPE and incorrect status on WebDAV HEAD for folders EXO-89265#2038
Jihed525 merged 1 commit into
patch/7.2.0from
patch-7.2.0-1

Conversation

@Jihed525

Copy link
Copy Markdown
Member

HeadWebDavHandler unconditionally read the GETCONTENTTYPE/GETCONTENTLENGTH properties, which are only populated for files, causing a NullPointerException on folders. It also always returned 204 No Content instead of mirroring the 200 OK returned by the equivalent GET.

The handler now branches on WebDavItem#isFile(): for a file it still reads Content-Type/Content-Length, now made null-safe through a setHeaderIfPresent helper; for a folder it sets Content-Type to text/html, matching the listing GetWebDavHandler renders for the same resource. The response status is now always 200 OK in both cases, consistent with what GetWebDavHandler returns.

(cherry picked from commit 280001d)

HeadWebDavHandler unconditionally read the GETCONTENTTYPE/GETCONTENTLENGTH
properties, which are only populated for files, causing a
NullPointerException on folders. It also always returned 204 No Content
instead of mirroring the 200 OK returned by the equivalent GET.

The handler now branches on WebDavItem#isFile(): for a file it still
reads Content-Type/Content-Length, now made null-safe through a
setHeaderIfPresent helper; for a folder it sets Content-Type to
text/html, matching the listing GetWebDavHandler renders for the same
resource. The response status is now always 200 OK in both cases,
consistent with what GetWebDavHandler returns.

(cherry picked from commit 280001d)
@Jihed525 Jihed525 self-assigned this Aug 12, 2026
@Jihed525
Jihed525 enabled auto-merge (rebase) August 12, 2026 15:43
@Jihed525
Jihed525 disabled auto-merge August 12, 2026 15:55
@Jihed525
Jihed525 merged commit 401346c into patch/7.2.0 Aug 12, 2026
9 checks passed
@Jihed525
Jihed525 deleted the patch-7.2.0-1 branch August 12, 2026 15:55
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