advise: use rawBody as the urllib data#11
Open
luckyscript wants to merge 1 commit intoeggjs:masterfrom
Open
Conversation
use rawBody as the urllib data
Author
|
@atian25 大佬有空可以看下这个PR么,不知道是否合理。 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
use rawBody as the urllib data
Checklist
npm testpassesAffected core subsystem(s)
Description of change
这里转发请求的时候,是否应该使用rawBody呢?使用requestBody可能会导致请求不一样,以下是case:
在content-type为 x-www-form-urlencoded 的情况下,是可以传递数组的,如:
这种请求,在egg这里解析后,requestBody为
rawBody为
如果将requestBody作为urllib的body传输
则发送的formdata实质为:
即
arr%5B1%5D=1&arr%5B2%5D=2
因此想问下这里为啥不直接采用rawBody呢