@abtnode/router-provider 1.16.14-beta-c2843ec5 → 1.16.14-beta-5ac0c68b
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/nginx/index.js +7 -0
- package/lib/util.js +1 -1
- package/package.json +6 -6
package/lib/nginx/index.js
CHANGED
|
@@ -519,6 +519,13 @@ class NginxProvider extends BaseProvider {
|
|
|
519
519
|
}
|
|
520
520
|
if (filter) {
|
|
521
521
|
location._add('include', `includes/image-filter-${filter}`);
|
|
522
|
+
} else if (ROUTER_CACHE_GROUPS[cacheGroup] && this.capabilities.httpImageFilter) {
|
|
523
|
+
location._add('set', '$filter "off"');
|
|
524
|
+
location._addVerbatimBlock(`if ($uri ~* "^${prefix}.*\\.(png|jpg|jpeg|webp)$")`, 'set $filter "on";');
|
|
525
|
+
location._addVerbatimBlock('if ($arg_imageFilter = "resize")', 'set $filter "${filter}resize";'); // eslint-disable-line no-template-curly-in-string
|
|
526
|
+
location._addVerbatimBlock('if ($arg_imageFilter = "crop")', 'set $filter "${filter}crop";'); // eslint-disable-line no-template-curly-in-string
|
|
527
|
+
location._addVerbatimBlock('if ($filter = "onresize")', `rewrite ${prefix}(.+) ${prefix}$1/resize last;`);
|
|
528
|
+
location._addVerbatimBlock('if ($filter = "oncrop")', `rewrite ${prefix}(.+) ${prefix}$1/crop last;`);
|
|
522
529
|
}
|
|
523
530
|
|
|
524
531
|
// Redirect blocklet traffic
|
package/lib/util.js
CHANGED
|
@@ -121,7 +121,7 @@ const formatRoutingTable = (routingTable, capabilities = {}) => {
|
|
|
121
121
|
['resize', 'crop'].forEach((filter) => {
|
|
122
122
|
const filterRule = cloneDeep(rule);
|
|
123
123
|
rule.filter = filter;
|
|
124
|
-
rule.suffix = `\\.(png|jpg|jpeg|
|
|
124
|
+
rule.suffix = `\\.(png|jpg|jpeg|webp)/${filter}`;
|
|
125
125
|
addRule(filterRule);
|
|
126
126
|
});
|
|
127
127
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abtnode/router-provider",
|
|
3
|
-
"version": "1.16.14-beta-
|
|
3
|
+
"version": "1.16.14-beta-5ac0c68b",
|
|
4
4
|
"description": "Routing engine implementations for abt node",
|
|
5
5
|
"author": "polunzh <polunzh@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/ArcBlock/blocklet-server#readme",
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
"url": "https://github.com/ArcBlock/blocklet-server/issues"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@abtnode/constant": "1.16.14-beta-
|
|
36
|
-
"@abtnode/logger": "1.16.14-beta-
|
|
37
|
-
"@abtnode/router-templates": "1.16.14-beta-
|
|
38
|
-
"@abtnode/util": "1.16.14-beta-
|
|
35
|
+
"@abtnode/constant": "1.16.14-beta-5ac0c68b",
|
|
36
|
+
"@abtnode/logger": "1.16.14-beta-5ac0c68b",
|
|
37
|
+
"@abtnode/router-templates": "1.16.14-beta-5ac0c68b",
|
|
38
|
+
"@abtnode/util": "1.16.14-beta-5ac0c68b",
|
|
39
39
|
"@arcblock/http-proxy": "^1.19.1",
|
|
40
40
|
"axios": "^0.27.2",
|
|
41
41
|
"debug": "^4.3.4",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"bluebird": "^3.7.2",
|
|
60
60
|
"fs-extra": "^10.1.0"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "f38cb0f87e1eac8e5acf0106561972f4cc1207e8"
|
|
63
63
|
}
|