Skip to content

Commit

Permalink
[futurepress#99] Support of the mod_setenv module (sets custom header…
Browse files Browse the repository at this point in the history
…s on requests/responses)
  • Loading branch information
birdofpreyru committed Feb 25, 2024
1 parent e188399 commit 9580721
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ set(PLUGIN_STATIC
PLUGIN_INIT(mod_h2)\n
PLUGIN_INIT(mod_indexfile)\n
PLUGIN_INIT(mod_rewrite)\n
PLUGIN_INIT(mod_setenv)\n
PLUGIN_INIT(mod_staticfile)\n
)

Expand Down
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
[MainBundlePath]: https://www.npmjs.com/package/@dr.pogodin/react-native-fs#mainbundlepath
[mod_alias]: https://redmine.lighttpd.net/projects/lighttpd/wiki/Mod_alias
[mod_rewrite]: https://redmine.lighttpd.net/projects/lighttpd/wiki/Mod_rewrite
[mod_setenv]: https://redmine.lighttpd.net/projects/lighttpd/wiki/Mod_setenv
[mod_webdav]: https://redmine.lighttpd.net/projects/lighttpd/wiki/Mod_webdav
[New Architecture]: https://reactnative.dev/docs/the-new-architecture/landing-page
[Old Architecture]: https://reactnative.dev/docs/native-modules-intro
Expand Down Expand Up @@ -64,6 +65,7 @@ and [old][Old Architecture] RN architectures.
- [Bundling-in Server Assets Into an App Statically]
- [Enabling Alias module]
- [Enabling Rewrite module]
- [Enabling SetEnv module]
- [Enabling WebDAV module]
- [Connecting to an Active Server in the Native Layer]
- [API Reference](#api-reference)
Expand Down Expand Up @@ -440,6 +442,23 @@ extraConfig: `
// GET "/file"
```
### Enabling SetEnv Module
[Enabling SetEnv module]: #enabling-setenv-module
[Lighttpd]'s built-in module [mod_setenv] allows to modify request and response
headers. To enable it just use `extraConfig` option of [Server] [constructor()]
to load and configure it, for example:
```ts
extraConfig: `
server.modules += ("mod_setenv")
setenv.add-response-header = (
"My-Custom-Header" => "my-custom-value"
"Another-Custom-Header" => "another-custom-value"
)
setenv.add-request-header = ("X-Proxy" => "my.server.name")
`,
```
### Enabling WebDAV Module
[Enabling WebDAV module]: #enabling-webdav-module
Expand Down

0 comments on commit 9580721

Please sign in to comment.