-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add brackets in
Host
header of http request when relevant.
See: mirage/ocaml-cohttp#997 Signed-off-by: Benjamin Reis <[email protected]>
- Loading branch information
1 parent
950ff05
commit 42ba1f8
Showing
2 changed files
with
31 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
Add brackets in `Host` header of http request when relevant. | ||
See: https://github.com/mirage/ocaml-cohttp/issues/997 | ||
|
||
diff --git i/ocaml/xapi/xapi_vm.ml w/ocaml/xapi/xapi_vm.ml | ||
index 4db86acbd..e310f5549 100644 | ||
--- i/ocaml/xapi/xapi_vm.ml | ||
+++ w/ocaml/xapi/xapi_vm.ml | ||
@@ -1518,7 +1518,17 @@ let rec import_inner n ~__context ~url ~sr ~full_restore ~force = | ||
Cohttp.Request.Make (Cohttp_posix_io.Unbuffered_IO) in | ||
let module Response = | ||
Cohttp.Response.Make (Cohttp_posix_io.Unbuffered_IO) in | ||
- let request = Cohttp.Request.make ~meth:`GET uri in | ||
+ let headers = Cohttp.Header.init () in | ||
+ let headers = | ||
+ Cohttp.Header.add_unless_exists headers "host" | ||
+ (match Uri.scheme uri with | ||
+ | Some "httpunix" -> "" | ||
+ | _ -> ( | ||
+ (Http.Url.maybe_wrap_IPv6_literal (Uri.host_with_default ~default:"localhost" uri)) | ||
+ ^ | ||
+ match Uri.port uri with Some p -> ":" ^ string_of_int p | None -> "")) | ||
+ in | ||
+ let request = Cohttp.Request.make ~meth:`GET ?headers:(Some headers) uri in | ||
let ic = | ||
{ | ||
Cohttp_posix_io.Unbuffered_IO.header_buffer= None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ | |
Summary: xapi - xen toolstack for XCP | ||
Name: xapi | ||
Version: 23.31.0 | ||
Release: 1.1%{?xsrel}%{?dist} | ||
Release: 1.2%{?xsrel}%{?dist} | ||
Group: System/Hypervisor | ||
License: LGPL-2.1-or-later WITH OCaml-LGPL-linking-exception | ||
URL: http://www.xen.org | ||
|
@@ -61,6 +61,7 @@ Patch1003: xapi-23.24.0-update-db-tunnel-protocol-from-other_config.XCP-ng.patch | |
# Needed for IPv6 support. Upstream wants a better fix. Drop when upstream fixed it. | ||
Patch1004: xapi-23.3.0-filter-link-local-address-ipv6.XCP-ng.patch | ||
Patch1005: xapi-23.31.0-extend-uefi-cert-api.patch | ||
Patch1006: xapi-23.31.0-fix-ipv6-import.XCP-ng.patch | ||
|
||
%{?_cov_buildrequires} | ||
BuildRequires: ocaml-ocamldoc | ||
|
@@ -1340,6 +1341,9 @@ Coverage files from unit tests | |
%{?_cov_results_package} | ||
|
||
%changelog | ||
* Thu Feb 08 2024 Benjamin Reis <[email protected]> - 23.31.0-1.2 | ||
- Add xapi-23.31.0-fix-ipv6-import.XCP-ng.patch | ||
|
||
* Mon Jan 22 2024 Samuel Verschelde <[email protected]> - 23.31.0-1.1 | ||
- Rebase on 23.31.0-1 | ||
- Rediff patches (Benjamin Reis) | ||
|