backend-manager 4.0.24 → 4.0.26
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/package.json
CHANGED
|
@@ -45,6 +45,16 @@ function BackendAssistant() {
|
|
|
45
45
|
return self;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
function tryUrl(req) {
|
|
49
|
+
try {
|
|
50
|
+
// return `${req.protocol}://${req.get('host')}${req.originalUrl}`
|
|
51
|
+
// Like this becuse "req.originalUrl" does NOT have path for all cases (like when calling https://us-central1-{id}.cloudfunctions.net/giftImport)
|
|
52
|
+
return `${req.protocol}://${req.get('host')}`
|
|
53
|
+
} catch {
|
|
54
|
+
return '';
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
48
58
|
function tryParse(input) {
|
|
49
59
|
var ret;
|
|
50
60
|
|
|
@@ -178,7 +188,7 @@ BackendAssistant.prototype.init = function (ref, options) {
|
|
|
178
188
|
} else {
|
|
179
189
|
self.request.type = 'form';
|
|
180
190
|
}
|
|
181
|
-
self.request.url =
|
|
191
|
+
self.request.url = tryUrl(self.ref.req);
|
|
182
192
|
self.request.path = self.ref.req.path || '';
|
|
183
193
|
self.request.user = self.resolveAccount({authenticated: false});
|
|
184
194
|
|