You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore: hostHeaders default value is empty string (#5413)
pick from #5412
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **Documentation**
- Updated plugin links to reflect the current repository addresses.
- Improved clarity on host header behavior and configuration, including
guidance for reverse proxy setups.
- Enhanced textual explanations for properties related to host and
protocol.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Copy file name to clipboardExpand all lines: site/docs/basics/controller.md
+6-5
Original file line number
Diff line number
Diff line change
@@ -315,7 +315,7 @@ If user request exceeds the maximum length for parsing that we configured, the f
315
315
316
316
### Acquiring the Submitted Files
317
317
318
-
The `body` in the request can carry parameters as well as files. Generally speaking, our browsers always send files in `multipart/form-data`, and we now have two kinds of ways supporting submitting and acquiring files with the help of the framework's plugin [Multipart](https://github.com/eggjs/multipart).
318
+
The `body` in the request can carry parameters as well as files. Generally speaking, our browsers always send files in `multipart/form-data`, and we now have two kinds of ways supporting submitting and acquiring files with the help of the framework's plugin [Multipart](https://github.com/eggjs/egg-multipart).
319
319
320
320
-#### `File` Mode:
321
321
If you have no ideas about Nodejs's Stream at all, the `File` mode suits you well:
@@ -589,7 +589,7 @@ module.exports = {
589
589
590
590
**Notice:`fileExtensions` will be IGNORED when `whitelist` is overwritten.**
591
591
592
-
For more tech details about this, please refer [@eggjs/multipart](https://github.com/eggjs/multipart).
592
+
For more tech details about this, please refer [Egg-Multipart](https://github.com/eggjs/egg-multipart).
593
593
594
594
### `header`
595
595
@@ -605,9 +605,10 @@ Specially when we set `config.proxy = true` to deploy the application behind the
605
605
606
606
#### `ctx.host`
607
607
608
-
Reads the header's value configured by `config.hostHeaders` firstly, if fails, then it tries to get the value of host header, if fails again, it returns an empty string.
608
+
Reads the header's value configured by `config.hostHeaders` firstly, if fails, then it tries to get the value of `host` header, if fails again, it returns an empty string.
609
609
610
-
`config.hostHeaders` defaults to `x-forwarded-host`.
610
+
`config.hostHeaders` defaults to `''`.
611
+
If the application is deployed behind a reverse proxy and `config.proxy = true` is configured, a correct value needs to be configured here, such as `x-forwarded-host`. Please configure it according to the actual value of the proxy.
611
612
612
613
#### `ctx.protocol`
613
614
@@ -684,7 +685,7 @@ module.exports = {
684
685
685
686
By using Cookie, we can create an individual Session specific to every user to store user identity information, which will be encrypted then stored in Cookie to perform session persistence across requests.
686
687
687
-
The framework builds in [Session](https://github.com/eggjs/session) plugin, which provides `ctx.session` for us to get or set current user's Session.
688
+
The framework builds in [Session](https://github.com/eggjs/egg-session) plugin, which provides `ctx.session` for us to get or set current user's Session.
0 commit comments