Skip to content

Commit aeef812

Browse files
committed
fix pdf headers
1 parent 2c986d8 commit aeef812

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ pydf is available as a docker image with a very simple http API for generating p
6969

7070
Simple ``POST`` (or ``GET`` with data if possible) you HTML data to ``/generate.pdf``.
7171

72-
Arguments can be passed using http headers; any header starting ``pdf-`` will
72+
Arguments can be passed using http headers; any header starting ``pdf-`` or ``pdf_`` will
7373
have that prefix removed, be converted to lower case and passed to wkhtmltopdf.
7474

7575
For example:

docker-entrypoint.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
To generate PDF POST (or GET with data if possible) you HTML data to /generate.pdf.
66
7-
Extra arguments can be passed using http headers; any header starting "pdf-" will
7+
Extra arguments can be passed using http headers; any header starting "pdf-" or "pdf_" will
88
have that prefix removed, be converted to lower case and passed to wkhtmltopdf.
99
1010
For example:
@@ -32,7 +32,7 @@ async def index(request):
3232
async def generate(request):
3333
config = {}
3434
for k, v in request.headers.items():
35-
if k.startswith('Pdf-'):
35+
if k.startswith('Pdf-') or k.startswith('Pdf_'):
3636
config[k[4:].lower()] = v.lower()
3737
data = await request.read()
3838
if not data:

0 commit comments

Comments
 (0)