From 115530a1049e704121126ff413981e6d9b06e4fa Mon Sep 17 00:00:00 2001 From: Pierre Tachoire Date: Mon, 9 Feb 2026 15:15:50 +0100 Subject: [PATCH 1/2] http: add PROPOFIND method test case --- src/browser/tests/legacy/xhr/xhr.html | 14 ++++++++++++++ src/browser/tests/net/request.html | 7 +++++++ 2 files changed, 21 insertions(+) diff --git a/src/browser/tests/legacy/xhr/xhr.html b/src/browser/tests/legacy/xhr/xhr.html index 2ff428b7..c7c557bd 100644 --- a/src/browser/tests/legacy/xhr/xhr.html +++ b/src/browser/tests/legacy/xhr/xhr.html @@ -106,3 +106,17 @@ testing.expectEqual(req5, target); }) + + + + From b9f8ce57299c6eecc5a8cfe84ce1a881ff996c6f Mon Sep 17 00:00:00 2001 From: Pierre Tachoire Date: Mon, 9 Feb 2026 15:03:20 +0100 Subject: [PATCH 2/2] http: allow PROPOFIND http method PROPOFIND is used by webdav to retrieve resource's properties. http://www.webdav.org/specs/rfc4918.html#METHOD_PROPFIND For example, Nextcloud public sharing uses PROPOFIND to list shared resources. --- src/browser/webapi/net/Request.zig | 3 ++- src/browser/webapi/net/XMLHttpRequest.zig | 3 +++ src/http/Http.zig | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/browser/webapi/net/Request.zig b/src/browser/webapi/net/Request.zig index 46cad2a1..4316ddbb 100644 --- a/src/browser/webapi/net/Request.zig +++ b/src/browser/webapi/net/Request.zig @@ -108,7 +108,7 @@ pub fn init(input: Input, opts_: ?InitOpts, page: *Page) !*Request { } fn parseMethod(method: []const u8, page: *Page) !Http.Method { - if (method.len > "options".len) { + if (method.len > "propfind".len) { return error.InvalidMethod; } @@ -122,6 +122,7 @@ fn parseMethod(method: []const u8, page: *Page) !Http.Method { .{ "patch", .PATCH }, .{ "head", .HEAD }, .{ "options", .OPTIONS }, + .{ "propfind", .PROPFIND }, }); return method_lookup.get(lower) orelse return error.InvalidMethod; } diff --git a/src/browser/webapi/net/XMLHttpRequest.zig b/src/browser/webapi/net/XMLHttpRequest.zig index 0bff9296..73e35309 100644 --- a/src/browser/webapi/net/XMLHttpRequest.zig +++ b/src/browser/webapi/net/XMLHttpRequest.zig @@ -539,6 +539,9 @@ fn parseMethod(method: []const u8) !Http.Method { if (std.ascii.eqlIgnoreCase(method, "put")) { return .PUT; } + if (std.ascii.eqlIgnoreCase(method, "propfind")) { + return .PROPFIND; + } return error.InvalidMethod; } diff --git a/src/http/Http.zig b/src/http/Http.zig index cd3b3ec9..65f298f2 100644 --- a/src/http/Http.zig +++ b/src/http/Http.zig @@ -211,6 +211,7 @@ pub const Connection = struct { .HEAD => "HEAD", .OPTIONS => "OPTIONS", .PATCH => "PATCH", + .PROPFIND => "PROPFIND", }; try errorCheck(c.curl_easy_setopt(easy, c.CURLOPT_CUSTOMREQUEST, m.ptr)); } @@ -342,6 +343,7 @@ pub const Method = enum(u8) { HEAD = 4, OPTIONS = 5, PATCH = 6, + PROPFIND = 7, }; // TODO: on BSD / Linux, we could just read the PEM file directly.