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

fix: repair the impact of JSONP on normal requests(#2692) #2699

Merged
merged 1 commit into from
Feb 1, 2023
Merged

fix: repair the impact of JSONP on normal requests(#2692) #2699

merged 1 commit into from
Feb 1, 2023

Conversation

abnerCrack
Copy link
Contributor

Checklist
  • npm test passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)
import { JSONPMiddleware } from '@midwayjs/cross-domain';
Impact scope: JSONPMiddleware
Description of change

Determine if a callback exists before performing JSONP content conversion, return original content if it doesn't exist

@codecov-commenter
Copy link

codecov-commenter commented Feb 1, 2023

Codecov Report

Base: 82.02% // Head: 81.87% // Decreases project coverage by -0.15% ⚠️

Coverage data is based on head (a438431) compared to base (9547067).
Patch coverage: 92.30% of modified lines in pull request are covered.

❗ Current head a438431 differs from pull request most recent head b42b339. Consider uploading reports for the commit b42b339 to get more accurate results

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2699      +/-   ##
==========================================
- Coverage   82.02%   81.87%   -0.15%     
==========================================
  Files         419      419              
  Lines       15019    15022       +3     
  Branches     3562     3564       +2     
==========================================
- Hits        12319    12299      -20     
- Misses       2450     2468      +18     
- Partials      250      255       +5     
Impacted Files Coverage Δ
packages/cross-domain/src/jsonp.ts 95.00% <92.30%> (+0.88%) ⬆️
packages/oss/src/manager.ts 31.70% <0.00%> (-53.66%) ⬇️
packages/oss/src/configuration.ts 60.00% <0.00%> (-40.00%) ⬇️
packages/bootstrap/src/util.ts 90.32% <0.00%> (+3.22%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@echosoar
Copy link
Member

echosoar commented Feb 1, 2023

jsonp 的设计是一个 utils 方法,需要用户决定应用 jsonp 的地方再使用 jsonp(body),所以不需要在内部再判断是否有callback 参数。
是允许不在请求的query 上传递 callback 参数的,默认callback 方法名就叫做 callback。

@echosoar echosoar self-requested a review February 1, 2023 09:26
@czy88840616 czy88840616 added the pr: bug fix This PR fixes a bug in a past release. label Feb 1, 2023
@czy88840616 czy88840616 merged commit a2d7ad7 into midwayjs:main Feb 1, 2023
czy88840616 added a commit that referenced this pull request Feb 2, 2023
czy88840616 added a commit that referenced this pull request Feb 2, 2023
@abnerCrack abnerCrack deleted the bugfix/fix_jsonp_impact branch February 6, 2023 02:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: bug fix This PR fixes a bug in a past release.
Development

Successfully merging this pull request may close these issues.

4 participants