-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Lazily initialize request.accept
#1209
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1209 +/- ##
==========================================
+ Coverage 99.73% 99.73% +<.01%
==========================================
Files 5 5
Lines 383 384 +1
==========================================
+ Hits 382 383 +1
Misses 1 1
Continue to review full report at Codecov.
|
lib/request.js
Outdated
* @return {Object} | ||
* @api public | ||
*/ | ||
get accept() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe you should add set accept()
to avoid breaking change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All right.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've pushed another commit to this PR.
lib/request.js
Outdated
* @api public | ||
*/ | ||
set accept(obj) { | ||
return this._accept = obj; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need a test case
lib/context.js
Outdated
@@ -194,6 +194,7 @@ delegate(proto, 'request') | |||
.access('query') | |||
.access('path') | |||
.access('url') | |||
.access('accpet') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Misspelled
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thx for reminding, i should have run a test
Added some test cases and reorganized the commits. @fl0w @dead-horse |
To save memory consumption.