xshell 1.0.89 → 1.0.90

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xshell",
3
- "version": "1.0.89",
3
+ "version": "1.0.90",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "bin": {
package/server.d.ts CHANGED
@@ -88,7 +88,7 @@ export declare class Server {
88
88
  /** 被子类重写以自定义处理逻辑 */
89
89
  router(ctx: Context): Promise<boolean>;
90
90
  /** 重定向 ctx 到 url (可以是完整 url 也可以是路径),设置 status code 为 code */
91
- redirect(ctx: Context, url: string, code?: 301 | 302): void;
91
+ redirect(ctx: Context, url: string, code?: 301 | 302): boolean;
92
92
  logger(ctx: Context): void;
93
93
  process_ua(ctx: Context): string;
94
94
  format_ua(headers: IncomingHttpHeaders | IncomingHttp2Headers): string;
package/server.js CHANGED
@@ -333,6 +333,7 @@ export class Server {
333
333
  response.redirect(url);
334
334
  response.status = code;
335
335
  console.log(`${code} 重定向 ${_path} -> ${url}`.yellow);
336
+ return true;
336
337
  }
337
338
  logger(ctx) {
338
339
  const { colors } = this;