We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ff25d8d commit 1bcd0c7Copy full SHA for 1bcd0c7
plugins/proxy/lib/utils.js
@@ -99,11 +99,17 @@ exports.getProxyRunner = (project, files) => ({
99
* Helper to get the trafix rule
100
*/
101
exports.getRule = rule => {
102
+ // we do this so getRule is backwards campatible with the older rule.host
103
+ const host = rule.hostname ?? rule.host;
104
+
105
// Start with the rule we can assume
- const hostRegex = rule.host.replace(new RegExp('\\*', 'g'), '{wildcard:[a-z0-9-]+}');
106
+ const hostRegex = host.replace(new RegExp('\\*', 'g'), '{wildcard:[a-z0-9-]+}');
107
const rules = [`HostRegexp(\`${hostRegex}\`)`];
108
109
// Add in the path prefix if we can
110
if (rule.pathname.length > 1) rules.push(`PathPrefix(\`${rule.pathname}\`)`);
111
112
+ // return
113
return rules.join(' && ');
114
};
115
0 commit comments