mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-08 00:22:14 +01:00
fix(pdfengines): require uploaded stamp/watermark file for image or pdf source
This commit is contained in:
@@ -1188,6 +1188,30 @@ Feature: /forms/chromium/convert/html
|
||||
Then the "foo.pdf" PDF should have 1 page(s)
|
||||
Then the "foo.pdf" PDF should have 1 image(s)
|
||||
|
||||
Scenario: POST /forms/chromium/convert/html (stampSource=pdf without uploaded stamp file => 400)
|
||||
Given I have a default Gotenberg container
|
||||
When I make a "POST" request to Gotenberg at the "/forms/chromium/convert/html" endpoint with the following form data and header(s):
|
||||
| files | testdata/page-1-html/index.html | file |
|
||||
| stampSource | pdf | field |
|
||||
| stampExpression | /etc/hostname | field |
|
||||
Then the response status code should be 400
|
||||
Then the response body should match string:
|
||||
"""
|
||||
Invalid form data: a stamp file is required for image or pdf source
|
||||
"""
|
||||
|
||||
Scenario: POST /forms/chromium/convert/html (watermarkSource=pdf without uploaded watermark file => 400)
|
||||
Given I have a default Gotenberg container
|
||||
When I make a "POST" request to Gotenberg at the "/forms/chromium/convert/html" endpoint with the following form data and header(s):
|
||||
| files | testdata/page-1-html/index.html | file |
|
||||
| watermarkSource | pdf | field |
|
||||
| watermarkExpression | /etc/hostname | field |
|
||||
Then the response status code should be 400
|
||||
Then the response body should match string:
|
||||
"""
|
||||
Invalid form data: a watermark file is required for image or pdf source
|
||||
"""
|
||||
|
||||
# See: https://github.com/gotenberg/gotenberg/issues/1500.
|
||||
Scenario: POST /forms/chromium/convert/html (Long Filename)
|
||||
Given I have a default Gotenberg container
|
||||
|
||||
@@ -1153,6 +1153,32 @@ Feature: /forms/chromium/convert/markdown
|
||||
Then the response status code should be 200
|
||||
Then the response header "Content-Type" should be "application/pdf"
|
||||
|
||||
Scenario: POST /forms/chromium/convert/markdown (stampSource=pdf without uploaded stamp file => 400)
|
||||
Given I have a default Gotenberg container
|
||||
When I make a "POST" request to Gotenberg at the "/forms/chromium/convert/markdown" endpoint with the following form data and header(s):
|
||||
| files | testdata/page-1-markdown/index.html | file |
|
||||
| files | testdata/page-1-markdown/page_1.md | file |
|
||||
| stampSource | pdf | field |
|
||||
| stampExpression | /etc/hostname | field |
|
||||
Then the response status code should be 400
|
||||
Then the response body should match string:
|
||||
"""
|
||||
Invalid form data: a stamp file is required for image or pdf source
|
||||
"""
|
||||
|
||||
Scenario: POST /forms/chromium/convert/markdown (watermarkSource=pdf without uploaded watermark file => 400)
|
||||
Given I have a default Gotenberg container
|
||||
When I make a "POST" request to Gotenberg at the "/forms/chromium/convert/markdown" endpoint with the following form data and header(s):
|
||||
| files | testdata/page-1-markdown/index.html | file |
|
||||
| files | testdata/page-1-markdown/page_1.md | file |
|
||||
| watermarkSource | pdf | field |
|
||||
| watermarkExpression | /etc/hostname | field |
|
||||
Then the response status code should be 400
|
||||
Then the response body should match string:
|
||||
"""
|
||||
Invalid form data: a watermark file is required for image or pdf source
|
||||
"""
|
||||
|
||||
# See: https://github.com/gotenberg/gotenberg/issues/1500.
|
||||
Scenario: POST /forms/chromium/convert/markdown (Long Filename)
|
||||
Given I have a default Gotenberg container
|
||||
|
||||
@@ -1269,6 +1269,32 @@ Feature: /forms/chromium/convert/url
|
||||
Then the response status code should be 200
|
||||
Then the response header "Content-Type" should be "application/pdf"
|
||||
|
||||
Scenario: POST /forms/chromium/convert/url (stampSource=pdf without uploaded stamp file => 400)
|
||||
Given I have a default Gotenberg container
|
||||
Given I have a static server
|
||||
When I make a "POST" request to Gotenberg at the "/forms/chromium/convert/url" endpoint with the following form data and header(s):
|
||||
| url | http://host.docker.internal:%d/html/testdata/page-1-html/index.html | field |
|
||||
| stampSource | pdf | field |
|
||||
| stampExpression | /etc/hostname | field |
|
||||
Then the response status code should be 400
|
||||
Then the response body should match string:
|
||||
"""
|
||||
Invalid form data: a stamp file is required for image or pdf source
|
||||
"""
|
||||
|
||||
Scenario: POST /forms/chromium/convert/url (watermarkSource=pdf without uploaded watermark file => 400)
|
||||
Given I have a default Gotenberg container
|
||||
Given I have a static server
|
||||
When I make a "POST" request to Gotenberg at the "/forms/chromium/convert/url" endpoint with the following form data and header(s):
|
||||
| url | http://host.docker.internal:%d/html/testdata/page-1-html/index.html | field |
|
||||
| watermarkSource | pdf | field |
|
||||
| watermarkExpression | /etc/hostname | field |
|
||||
Then the response status code should be 400
|
||||
Then the response body should match string:
|
||||
"""
|
||||
Invalid form data: a watermark file is required for image or pdf source
|
||||
"""
|
||||
|
||||
# See: https://github.com/gotenberg/gotenberg/issues/1500.
|
||||
Scenario: POST /forms/chromium/convert/url (Long Filename)
|
||||
Given I have a default Gotenberg container
|
||||
|
||||
@@ -817,6 +817,30 @@ Feature: /forms/libreoffice/convert
|
||||
Then the response status code should be 200
|
||||
Then the response header "Content-Type" should be "application/pdf"
|
||||
|
||||
Scenario: POST /forms/libreoffice/convert (stampSource=pdf without uploaded stamp file => 400)
|
||||
Given I have a default Gotenberg container
|
||||
When I make a "POST" request to Gotenberg at the "/forms/libreoffice/convert" endpoint with the following form data and header(s):
|
||||
| files | testdata/page_1.docx | file |
|
||||
| stampSource | pdf | field |
|
||||
| stampExpression | /etc/hostname | field |
|
||||
Then the response status code should be 400
|
||||
Then the response body should match string:
|
||||
"""
|
||||
Invalid form data: a stamp file is required for image or pdf source
|
||||
"""
|
||||
|
||||
Scenario: POST /forms/libreoffice/convert (watermarkSource=pdf without uploaded watermark file => 400)
|
||||
Given I have a default Gotenberg container
|
||||
When I make a "POST" request to Gotenberg at the "/forms/libreoffice/convert" endpoint with the following form data and header(s):
|
||||
| files | testdata/page_1.docx | file |
|
||||
| watermarkSource | pdf | field |
|
||||
| watermarkExpression | /etc/hostname | field |
|
||||
Then the response status code should be 400
|
||||
Then the response body should match string:
|
||||
"""
|
||||
Invalid form data: a watermark file is required for image or pdf source
|
||||
"""
|
||||
|
||||
# See: https://github.com/gotenberg/gotenberg/issues/1500.
|
||||
Scenario: POST /forms/libreoffice/convert (Long Filename)
|
||||
Given I have a default Gotenberg container
|
||||
|
||||
@@ -665,6 +665,32 @@ Feature: /forms/pdfengines/merge
|
||||
| embeds | testdata/embed_1.xml | file |
|
||||
Then the response status code should be 200
|
||||
|
||||
Scenario: POST /forms/pdfengines/merge (stampSource=pdf without uploaded stamp file => 400)
|
||||
Given I have a default Gotenberg container
|
||||
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/merge" endpoint with the following form data and header(s):
|
||||
| files | testdata/page_1.pdf | file |
|
||||
| files | testdata/page_2.pdf | file |
|
||||
| stampSource | pdf | field |
|
||||
| stampExpression | /etc/hostname | field |
|
||||
Then the response status code should be 400
|
||||
Then the response body should match string:
|
||||
"""
|
||||
Invalid form data: a stamp file is required for image or pdf source
|
||||
"""
|
||||
|
||||
Scenario: POST /forms/pdfengines/merge (watermarkSource=pdf without uploaded watermark file => 400)
|
||||
Given I have a default Gotenberg container
|
||||
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/merge" endpoint with the following form data and header(s):
|
||||
| files | testdata/page_1.pdf | file |
|
||||
| files | testdata/page_2.pdf | file |
|
||||
| watermarkSource | pdf | field |
|
||||
| watermarkExpression | /etc/hostname | field |
|
||||
Then the response status code should be 400
|
||||
Then the response body should match string:
|
||||
"""
|
||||
Invalid form data: a watermark file is required for image or pdf source
|
||||
"""
|
||||
|
||||
# See: https://github.com/gotenberg/gotenberg/issues/1500.
|
||||
Scenario: POST /forms/pdfengines/merge (Long Filename)
|
||||
Given I have a default Gotenberg container
|
||||
|
||||
@@ -767,6 +767,34 @@ Feature: /forms/pdfengines/split
|
||||
| embeds | testdata/embed_1.xml | file |
|
||||
Then the response status code should be 200
|
||||
|
||||
Scenario: POST /forms/pdfengines/split (stampSource=pdf without uploaded stamp file => 400)
|
||||
Given I have a default Gotenberg container
|
||||
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/split" endpoint with the following form data and header(s):
|
||||
| files | testdata/pages_3.pdf | file |
|
||||
| splitMode | intervals | field |
|
||||
| splitSpan | 2 | field |
|
||||
| stampSource | pdf | field |
|
||||
| stampExpression | /etc/hostname | field |
|
||||
Then the response status code should be 400
|
||||
Then the response body should match string:
|
||||
"""
|
||||
Invalid form data: a stamp file is required for image or pdf source
|
||||
"""
|
||||
|
||||
Scenario: POST /forms/pdfengines/split (watermarkSource=pdf without uploaded watermark file => 400)
|
||||
Given I have a default Gotenberg container
|
||||
When I make a "POST" request to Gotenberg at the "/forms/pdfengines/split" endpoint with the following form data and header(s):
|
||||
| files | testdata/pages_3.pdf | file |
|
||||
| splitMode | intervals | field |
|
||||
| splitSpan | 2 | field |
|
||||
| watermarkSource | pdf | field |
|
||||
| watermarkExpression | /etc/hostname | field |
|
||||
Then the response status code should be 400
|
||||
Then the response body should match string:
|
||||
"""
|
||||
Invalid form data: a watermark file is required for image or pdf source
|
||||
"""
|
||||
|
||||
# See: https://github.com/gotenberg/gotenberg/issues/1500.
|
||||
Scenario: POST /forms/pdfengines/split (Long Filename)
|
||||
Given I have a default Gotenberg container
|
||||
|
||||
Reference in New Issue
Block a user