Treat the X-Forwarded-Host header as the Host header
Project description
datasette-x-forwarded-host
Treat the X-Forwarded-Host header as the Host header
Installation
Install this plugin in the same environment as Datasette.
$ datasette install datasette-x-forwarded-host
Usage
Once installed, Datasette will replace the host
header with the content of the incoming x-forwarded-host
header.
This helps Datasette generate links to new pages that work when hosted behind a proxy that rewrites the host
header.
Only use this plugin in deployment environmens where you know the x-forwarded-host
header can be trusted!
This has been tested on GitHub Codespaces.
Development
To set up this plugin locally, first checkout the code. Then create a new virtual environment:
cd datasette-x-forwarded-host
python3 -mvenv venv
source venv/bin/activate
Or if you are using pipenv
:
pipenv shell
Now install the dependencies and test dependencies:
pip install -e '.[test]'
To run the tests:
pytest
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for datasette-x-forwarded-host-0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66a516c88be7dcf8816a1140272ec234b4fff8825247de0cc3b9c22e2c6404e6 |
|
MD5 | a948a409d5db5fe5ce85591d68eb816d |
|
BLAKE2b-256 | e9b7b3f67732b39e858bfc778498820ca646851410e316ede0c1179df17c53a9 |
Hashes for datasette_x_forwarded_host-0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81029ec554dcea24bdd74a69e8ce39e2f2dd089b12e5ecb302a709ee25410467 |
|
MD5 | 7f582027989888436838ee8aa66fe5bf |
|
BLAKE2b-256 | 8701e7d2b3fb997e2fe537fa8cc33216b3e7f9ccf50d5476fa460fa32915cbe3 |