@abtnode/router-provider 1.16.14-beta-c2843ec5 → 1.16.14-beta-be739405
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/includes/brotli +28 -0
- package/lib/nginx/index.js +7 -0
- package/lib/nginx/util.js +1 -0
- package/lib/util.js +1 -1
- package/package.json +6 -6
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
brotli on;
|
|
2
|
+
brotli_comp_level 6;
|
|
3
|
+
brotli_static on;
|
|
4
|
+
brotli_types
|
|
5
|
+
application/atom+xml
|
|
6
|
+
application/javascript
|
|
7
|
+
application/json
|
|
8
|
+
application/rss+xml
|
|
9
|
+
application/vnd.ms-fontobject
|
|
10
|
+
application/x-font-opentype
|
|
11
|
+
application/x-font-truetype
|
|
12
|
+
application/x-font-ttf
|
|
13
|
+
application/x-javascript
|
|
14
|
+
application/xhtml+xml
|
|
15
|
+
application/xml
|
|
16
|
+
font/eot
|
|
17
|
+
font/otf
|
|
18
|
+
font/opentype
|
|
19
|
+
font/truetype
|
|
20
|
+
image/svg+xml
|
|
21
|
+
image/vnd.microsoft.icon
|
|
22
|
+
image/x-icon
|
|
23
|
+
image/x-win-bitmap
|
|
24
|
+
text/html
|
|
25
|
+
text/css
|
|
26
|
+
text/javascript
|
|
27
|
+
text/plain
|
|
28
|
+
text/xml;
|
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/nginx/util.js
CHANGED
|
@@ -213,6 +213,7 @@ http {
|
|
|
213
213
|
include includes/params;
|
|
214
214
|
include includes/mime.types;
|
|
215
215
|
include includes/compression;
|
|
216
|
+
${capabilities.httpBrotli ? 'include includes/brotli;' : ''}
|
|
216
217
|
${capabilities.httpImageFilter ? 'include includes/image-filter-args;' : ''}
|
|
217
218
|
|
|
218
219
|
${Object.keys(ROUTER_CACHE_GROUPS)
|
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-be739405",
|
|
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-be739405",
|
|
36
|
+
"@abtnode/logger": "1.16.14-beta-be739405",
|
|
37
|
+
"@abtnode/router-templates": "1.16.14-beta-be739405",
|
|
38
|
+
"@abtnode/util": "1.16.14-beta-be739405",
|
|
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": "4a7be8e8a321f8be5b172c10c09c32af216a1c73"
|
|
63
63
|
}
|