Spaces:
Build error
Build error
chore: prefer ctx.URL
Browse files- src/api/crawler.ts +2 -3
src/api/crawler.ts
CHANGED
|
@@ -228,9 +228,8 @@ export class CrawlerHost extends RPCHost {
|
|
| 228 |
let chargeAmount = 0;
|
| 229 |
const crawlerOptions = ctx.method === 'GET' ? crawlerOptionsHeaderOnly : crawlerOptionsParamsAllowed;
|
| 230 |
|
| 231 |
-
// ctx.
|
| 232 |
-
|
| 233 |
-
const targetUrl = await this.getTargetUrl(tryDecodeURIComponent(ctx.url), crawlerOptions);
|
| 234 |
if (!targetUrl) {
|
| 235 |
return await this.getIndex(auth);
|
| 236 |
}
|
|
|
|
| 228 |
let chargeAmount = 0;
|
| 229 |
const crawlerOptions = ctx.method === 'GET' ? crawlerOptionsHeaderOnly : crawlerOptionsParamsAllowed;
|
| 230 |
|
| 231 |
+
// Use koa ctx.URL, a standard URL object to avoid node.js framework prop naming confusion
|
| 232 |
+
const targetUrl = await this.getTargetUrl(tryDecodeURIComponent(`${ctx.URL.pathname}${ctx.URL.search}`), crawlerOptions);
|
|
|
|
| 233 |
if (!targetUrl) {
|
| 234 |
return await this.getIndex(auth);
|
| 235 |
}
|