xhr: implement responseURL

This commit is contained in:
Pierre Tachoire committed 2024-02-15 16:43:02 +01:00
1 parent 34015b8f57
commit ff754fc666
1 file changed
+5
+5
View File
@@ -467,6 +467,11 @@ pub const XMLHttpRequest = struct {
}
}
// TODO retrieve the redirected url
pub fn get_responseURL(self: *XMLHttpRequest) ?[]const u8 {
return self.url;
}
pub fn get_responseXML(self: *XMLHttpRequest, alloc: std.mem.Allocator) !?Response {
if (self.response_type != .Empty and self.response_type != .Document) {
return DOMError.InvalidState;