mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-08-25 17:55:21 +00:00
mitm-cache: fetch: drop query
mitm-cache ignores the query: https://github.com/chayleaf/mitm-cache/blob/382b822/src/main.rs#L90 This fixes fetching URLs with query parameters. Signed-off-by: David Wronek <david.wronek@mainlining.org>
This commit is contained in:
@@ -19,15 +19,18 @@ let
|
||||
|
||||
urlToPath =
|
||||
url:
|
||||
if lib.hasPrefix "https://" url then
|
||||
(
|
||||
let
|
||||
url' = lib.drop 2 (lib.splitString "/" url);
|
||||
in
|
||||
"https/${builtins.concatStringsSep "/" url'}"
|
||||
)
|
||||
else
|
||||
builtins.replaceStrings [ "://" ] [ "/" ] url;
|
||||
lib.elemAt (lib.splitString "?" (
|
||||
if lib.hasPrefix "https://" url then
|
||||
(
|
||||
let
|
||||
url' = lib.drop 2 (lib.splitString "/" url);
|
||||
in
|
||||
"https/${builtins.concatStringsSep "/" url'}"
|
||||
)
|
||||
else
|
||||
builtins.replaceStrings [ "://" ] [ "/" ] url
|
||||
)) 0;
|
||||
|
||||
code = ''
|
||||
mkdir -p "$out"
|
||||
cd "$out"
|
||||
|
||||
Reference in New Issue
Block a user