-
-
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
docs: update specific for auto response status #1493
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1493 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 4 4
Lines 487 487
Branches 136 136
=========================================
Hits 487 487 Continue to review full report at Codecov.
|
docs/api/response.md
Outdated
- `null` no content response | ||
- `null` || `undfined` no content response | ||
|
||
If `response.status` has not been set, Koa will automatically set the status to `200` or `204` depending on `response.body`. Specifically, if `response.body` has not been set or has been set as `null` || `undfined`, which means no content response, Koa will automatically set `response.status` to `204`. If you really want to send no content response with other status, you should override the `204` status as the following way: |
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.
undfined
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.
I would remove which means no content response
, the reason to why null or undefined it set is ambiguous to Koa - but it interprets it as 204 No Content as you wrote.
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.
NIT: I would not use ||
's for documentation text, rather use explicit or
. However, as it's how it's defined in the list above I wouldn't mind keeping it if its clearer.
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.
Thanks. That was updated. I also thought about or
against ||
as definition listed above. Now i change to use or
for documentation text.
4d3ff08
to
6292f8c
Compare
fix: #1464