godprotocol 2.2.65 → 2.2.67
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
|
@@ -183,12 +183,15 @@ class Route_table extends Headers {
|
|
|
183
183
|
let route = await this.get_route(name);
|
|
184
184
|
|
|
185
185
|
if (!route) {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
186
|
+
route = await this.get_route("*");
|
|
187
|
+
if (!route) {
|
|
188
|
+
return {
|
|
189
|
+
ok: false,
|
|
190
|
+
status: 404,
|
|
191
|
+
message: "Route not found",
|
|
192
|
+
data: { path: `/${name}`, name },
|
|
193
|
+
};
|
|
194
|
+
}
|
|
192
195
|
}
|
|
193
196
|
|
|
194
197
|
let { handler, config } = route;
|
|
@@ -136,11 +136,15 @@ class Services {
|
|
|
136
136
|
|
|
137
137
|
handle_webhook_after = async (req, result) => {
|
|
138
138
|
let { headers, body, route } = req;
|
|
139
|
-
let { xplatform, platform } = headers;
|
|
139
|
+
let { xplatform, third_party, platform } = headers;
|
|
140
140
|
|
|
141
141
|
if (xplatform && xplatform.uri !== platform.uri) {
|
|
142
|
-
|
|
143
|
-
|
|
142
|
+
let webhook = third_party?.webhook || xplatform.webhook;
|
|
143
|
+
|
|
144
|
+
if (webhook?.enabled) {
|
|
145
|
+
if (webhook?.routes?.length && !webhook?.routes?.includes(route))
|
|
146
|
+
return;
|
|
147
|
+
|
|
144
148
|
await fetch(webhook?.url, {
|
|
145
149
|
method: "POST",
|
|
146
150
|
headers: {
|