[DRAFT] Feature - Allow fetching external urls matching a regex pattern #8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello there
We are currently using a similar container, but it's abandoned. Therefore, we are looking for a new solutions, and yours looks great. Unfortunately, there is currently this limitation in place, which makes it unusable for us, therefore we are suggesting a new feature.
Description
This PR adds a new feature, allowing to fetch external urls. As I understand, that the restriction on external urls is in place as security measure, which is very reasonable. Therefore, the default of this feature would be to still suppress all requests to external urls.
But it adds the possibility to configure one or more patterns for external, urls that are allowed. Example of the configuration
With this example, it would be possible to fetch fonts and logos from the storage of our site example.com. Of course, a regex pattern makes this very flexible.
Our use-case
Our customers are able to create their own templates in our web-editor. This renders HTML-previews in real-time in the browser, so there is no need to constantly refresh the PDF-preview. Because this all runs in the browser, we store the available fonts on our CDN-server, which the browser can fetch directly. It's much simpler to provide font files or shared pictures in a CDN than to fetch them all in the application and pass them as asset in the form.
This is a draft. I think, the implementation is fine like this (excepct if you request changes). I'm willing to add example and documentation.
I'm currently not sure, if there are automated tests in place? I'm happy to add them for our feature as well, if you can point me in the right direction.