Skip to content

Commit 4a2210d

Browse files
authored
MCLOUD-7192: Warm up Category Pages ends up with trailing slashes (#3)
1 parent fedecb1 commit 4a2210d

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

Model/UrlFixer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ public function run(Store $store, $url): string
2929
return preg_replace('|/magento/|', '/', $url, 1);
3030
}
3131

32-
return $url;
32+
return rtrim($url, '/');
3333
}
3434
}

Test/Unit/Model/UrlFixerTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,17 +74,17 @@ public function runDataProvider(): array
7474
return [
7575
'rewrites enabled, url without "magento" part' => [
7676
'http://example.com/',
77-
'http://example.com/',
77+
'http://example.com',
7878
],
7979
'rewrites disabled, url without "magento" part' => [
8080
'http://example.com/',
81-
'http://example.com/',
81+
'http://example.com',
8282
true,
8383
true,
8484
],
8585
'rewrites enabled, url with "magento" part' => [
8686
'http://example.com/magento/',
87-
'http://example.com/magento/',
87+
'http://example.com/magento',
8888
false,
8989
true,
9090
],
@@ -108,13 +108,13 @@ public function runDataProvider(): array
108108
],
109109
'rewrites disabled, url with "magento2" part' => [
110110
'http://example.com/magento2/',
111-
'http://example.com/magento2/',
111+
'http://example.com/magento2',
112112
true,
113113
false,
114114
],
115115
'rewrites disabled, with "magento" host' => [
116116
'http://magento.com/magento2/',
117-
'http://magento.com/magento2/',
117+
'http://magento.com/magento2',
118118
true,
119119
false,
120120
],

travis.php.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
memory_limit = 4G

0 commit comments

Comments
 (0)