xhr: implement responseURL

This commit is contained in:
Pierre Tachoire
2024-02-12 21:50:01 +01:00
parent 34015b8f57
commit ff754fc666

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;