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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file datasette-x-forwarded-host-0.1.tar.gz.
File metadata
- Download URL: datasette-x-forwarded-host-0.1.tar.gz
- Upload date:
- Size: 2.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
66a516c88be7dcf8816a1140272ec234b4fff8825247de0cc3b9c22e2c6404e6
|
|
| MD5 |
a948a409d5db5fe5ce85591d68eb816d
|
|
| BLAKE2b-256 |
e9b7b3f67732b39e858bfc778498820ca646851410e316ede0c1179df17c53a9
|
File details
Details for the file datasette_x_forwarded_host-0.1-py3-none-any.whl.
File metadata
- Download URL: datasette_x_forwarded_host-0.1-py3-none-any.whl
- Upload date:
- Size: 2.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
81029ec554dcea24bdd74a69e8ce39e2f2dd089b12e5ecb302a709ee25410467
|
|
| MD5 |
7f582027989888436838ee8aa66fe5bf
|
|
| BLAKE2b-256 |
8701e7d2b3fb997e2fe537fa8cc33216b3e7f9ccf50d5476fa460fa32915cbe3
|