Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: misc router #552

Merged
merged 1 commit into from
Jul 17, 2023
Merged

feat: misc router #552

merged 1 commit into from
Jul 17, 2023

Conversation

elrrrrrrr
Copy link
Member

image

close #551 , 针对未实现的 post 请求添加错误码

  1. 🧶 拦截 audit 相关接口 ref
  2. ♻️ 默认 404 GET 接口不做额外处理

close #551, add error code for unimplemented post requests

  1. 🧶 Intercept audit-related interfaces ref
  2. ♻️ No additional processing for default 404 GET interfaces.

@elrrrrrrr elrrrrrrr added the enhancement New feature or request label Jul 17, 2023
@codecov
Copy link

codecov bot commented Jul 17, 2023

Codecov Report

Merging #552 (c581f72) into master (8a9412d) will decrease coverage by 0.06%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #552      +/-   ##
==========================================
- Coverage   97.02%   96.97%   -0.06%     
==========================================
  Files         174      174              
  Lines       16641    16658      +17     
  Branches     2183     2185       +2     
==========================================
+ Hits        16146    16154       +8     
- Misses        495      504       +9     
Impacted Files Coverage Δ
app/port/controller/HomeController.ts 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

@gemwuu gemwuu merged commit e9e3a7b into master Jul 17, 2023
11 of 13 checks passed
@gemwuu gemwuu deleted the misc-router branch July 17, 2023 06:52
fengmk2 pushed a commit that referenced this pull request Jul 17, 2023
[skip ci]

## [3.38.0](v3.37.1...v3.38.0) (2023-07-17)

### Features

* misc router ([#552](#552)) ([e9e3a7b](e9e3a7b)), closes [#551](#551)
@HTTPMethod({
path: '/*',
method: HTTPMethodEnum.POST,
priority: -Infinity,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这算黑魔法么

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

目前似乎没有其他方式实现,z-index:1000 😄


const startTime = new Date();

const NOT_IMPLEMENTED = [ '/-/npm/v1/security/audits/quick', '/-/npm/v1/security/advisories/bulk' ];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为啥要这样黑名单?这样不在黑名单里面的 post 不是也会被攻击么。

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这些是标记目前暂不支持的方法,返回 501 更贴切一些

其余方法仍默认返回 404

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

不对所有请求都做 bodyParser
3 participants