message: fixed context to work well when there is no request
diff: @@ -151,12 +151,17 @@ export class ServerContext extends Context {
  }
  getHost() {
  + if (!this.req)
  + return undefined;
  return this.req.getHeader('host');
  }
  getPathInUrl() {
  + if (!this.req)
  + return undefined;
  return this.req.getBaseUrl();
  }
  getCookie(name: string) {
  + if (this.req) {
  let cookie = this.req.getHeader('cookie');
  if (cookie)
  for (const iterator of cookie.split(';')) {
  @@ -165,6 +170,7 @@ export class ServerContext extends Context {
  return itemInfo[1];
  }
  }
  + }
  return undefined;
  }
  private req: DataApiRequest;
  @@ -177,6 +183,8 @@ export class ServerContext extends Context {
  this._dataSource = dataProvider;
  }
  getOrigin() {
  + if (!this.req)
  + return undefined;
  return this.req.getHeader('origin')
  }
  }
  