Skip to main content

Treat the X-Forwarded-Host header as the Host header

Project description

datasette-x-forwarded-host

PyPI Changelog Tests License

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

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

datasette-x-forwarded-host-0.1.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

datasette_x_forwarded_host-0.1-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

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

Hashes for datasette-x-forwarded-host-0.1.tar.gz
Algorithm Hash digest
SHA256 66a516c88be7dcf8816a1140272ec234b4fff8825247de0cc3b9c22e2c6404e6
MD5 a948a409d5db5fe5ce85591d68eb816d
BLAKE2b-256 e9b7b3f67732b39e858bfc778498820ca646851410e316ede0c1179df17c53a9

See more details on using hashes here.

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

Hashes for datasette_x_forwarded_host-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 81029ec554dcea24bdd74a69e8ce39e2f2dd089b12e5ecb302a709ee25410467
MD5 7f582027989888436838ee8aa66fe5bf
BLAKE2b-256 8701e7d2b3fb997e2fe537fa8cc33216b3e7f9ccf50d5476fa460fa32915cbe3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page