diff --git a/packages/env/lib/config/parse-config.js b/packages/env/lib/config/parse-config.js index 9c7426e6601a6..9528ac8b3528c 100644 --- a/packages/env/lib/config/parse-config.js +++ b/packages/env/lib/config/parse-config.js @@ -111,7 +111,7 @@ function parseSourceString( sourceString, { workDirectoryPath } ) { } const zipFields = sourceString.match( - /^https?:\/\/([^\s$.?#].[^\s]*)\.zip$/ + /^https?:\/\/([^\s$.?#].[^\s]*)\.zip(\?.+)?$/ ); if ( zipFields ) { diff --git a/packages/env/lib/config/test/config.js b/packages/env/lib/config/test/config.js index 1ca5a75d71bd7..5552ecce9d70f 100644 --- a/packages/env/lib/config/test/config.js +++ b/packages/env/lib/config/test/config.js @@ -526,6 +526,7 @@ describe( 'readConfig', () => { plugins: [ 'https://www.example.com/test/path/to/gutenberg.zip', 'https://www.example.com/test/path/to/gutenberg.8.1.0.zip', + 'https://www.example.com/test/path/to/gutenberg.8.1.0.zip?auth=thisIsAString&token=secondString', 'https://www.example.com/test/path/to/twentytwenty.zip', 'https://www.example.com/test/path/to/twentytwenty.1.3.zip', 'https://example.com/twentytwenty.1.3.zip', @@ -550,6 +551,14 @@ describe( 'readConfig', () => { ), basename: 'gutenberg.8.1.0', }, + { + type: 'zip', + url: 'https://www.example.com/test/path/to/gutenberg.8.1.0.zip?auth=thisIsAString&token=secondString', + path: expect.stringMatching( + /^(\/|\\).*gutenberg.8.1.0$/ + ), + basename: 'gutenberg.8.1.0', + }, { type: 'zip', url: 'https://www.example.com/test/path/to/twentytwenty.zip',