-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable Remote HTTP assets #17
base: master
Are you sure you want to change the base?
Conversation
… for local/remote mixed files
On the failed unit test: it works, but sometimes httpbin times out before sending the response. Do you have any thoughts on how to test this more reliably? |
Hello @mhawker thank you for your great work.
|
Good evening @krichprollsch So, I tried to integrate your suggestions. The class is growing in size a lot; it's now close to 500 LoC. Do you think it needs a refactor or are you OK with the size? For the API, I removed the set/unset options. The enableHttp method now accepts two arguments: a boolean to enable HTTP assets and a $flags argument for HTTP-specific options. On the other hand, I added a I had to add better mime type detection in order to get the options working for local assets. Please tell me what you think about the solution. I thought it was important to keep the class as a stand-alone rather than distributing a mime.types file as part of it. The method The scrutinizer score is still pretty low because some of the methods are too complex. I'll have to think about how to fix it. Do you have any suggestions? Thanks again for your time and have a good one. Matt |
@krichprollsch
OK, third times a charm (sorry).
This pull request adds the ability to work with remote HTTP assets or remote stylesheets. It does not modify the default functionality of the class in any way; enabling the embed of remote assets requires that the
enableHttp
method be called.There are flags for just about every use-case that I can imagine. I documentation is complete. I'm pretty sure that everything is covered with unit tests except when the user specifically requests to embed remote font files (not default behaviour).
Thanks,