From fddaedeb083afe528cde91798960d8e2d4cfdc5e Mon Sep 17 00:00:00 2001 From: Jesse Rosenberger Date: Sat, 16 Jul 2016 13:46:29 +0300 Subject: [PATCH] Don't rewrite network path references in CSS URLs. Fixes regression caused in 1.3.4.1 which caused network path reference URLs (i.e. //img.domain.com/path/font.eot) used in CSS `url()`'s' to be stripped of their leading slashes causing them to become relative URL paths. Closes meteor/meteor#7416 --- packages/minifier-css/minifier.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/minifier-css/minifier.js b/packages/minifier-css/minifier.js index bd88ede21d..0994ee6fc8 100644 --- a/packages/minifier-css/minifier.js +++ b/packages/minifier-css/minifier.js @@ -136,8 +136,9 @@ var rewriteRules = function (rules, mergedCssPath) { // We don't rewrite URLs starting with a protocol definition such as - // http, https, or data. - if (resource.protocol !== null) { + // http, https, or data, or those with network-path references + // i.e. //img.domain.com/cat.gif + if (resource.protocol !== null || resource.href.startsWith('//')) { continue; }