-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
> Closes #551 Some versions encounter issues with audit requests using the GET method & gzip * 🧶 Modified the NOT_IMPLEMENTED configuration to skip bodyParser parsing by default. * 🧶 Added homeService and implemented miscellaneous methods to handle additional routes. ------ > Closes #551 部分版本 audit 请求为 get 且 参数解析异常 * 🧶 修改 NOT_IMPLEMENTED 配置,默认跳过 bodyParser 解析 * 🧶 添加 homeService,提供 misc 方法处理额外路由 --------- Co-authored-by: fengmk2 <[email protected]>
- Loading branch information
Showing
6 changed files
with
52 additions
and
36 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { | ||
AccessLevel, | ||
SingletonProto, | ||
} from '@eggjs/tegg'; | ||
import { AbstractService } from '../../common/AbstractService'; | ||
import { NOT_IMPLEMENTED_PATH } from '../../common/constants'; | ||
import { NotFoundError, NotImplementedError } from 'egg-errors'; | ||
|
||
@SingletonProto({ | ||
accessLevel: AccessLevel.PUBLIC, | ||
}) | ||
export class HomeService extends AbstractService { | ||
async misc(path: string) { | ||
if (NOT_IMPLEMENTED_PATH.includes(path)) { | ||
throw new NotImplementedError(`${path} not implemented yet`); | ||
} | ||
throw new NotFoundError(`${path} not found`); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters