diff --git a/Documentation/gitprotocol-v2.txt b/Documentation/gitprotocol-v2.txt index 837ea6171e..414bc625d5 100644 --- a/Documentation/gitprotocol-v2.txt +++ b/Documentation/gitprotocol-v2.txt @@ -362,7 +362,8 @@ included in the client's request: If the 'packfile-uris' feature is advertised, the following argument can be included in the client's request as well as the potential addition of the 'packfile-uris' section in the server's response as -explained below. +explained below. Note that at most one `packfile-uris` line can be sent +to the server. packfile-uris Indicates to the server that the client is willing to receive diff --git a/upload-pack.c b/upload-pack.c index 8b47576ec7..2a5c52666e 100644 --- a/upload-pack.c +++ b/upload-pack.c @@ -1646,6 +1646,9 @@ static void process_args(struct packet_reader *request, } if (skip_prefix(arg, "packfile-uris ", &p)) { + if (data->uri_protocols.nr) + send_err_and_die(data, + "multiple packfile-uris lines forbidden"); string_list_split(&data->uri_protocols, p, ',', -1); continue; }