As discussed in #18603 caching a 201 response is hard. It's now possible to distinguish between generated and uploaded avatars by reading the X-NC-IsCustomAvatar (0 = generated, 1 = uploaded) header.
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
The custom config allows to setup a proxy URI that is passed to
GuzzleHTTP client as request options. Guzzle has the option to receive
an array of proxies for each URI scheme as well as 'no' key value pair
to provide a list of host names that should not be proxied to.
Guzzle would automatically populate these options with HTTPS_PROXY
and NO_PROXY environment variables. However, when providing a 'proxy'
request option, default values will be overriden and it is required to
explicitly provide the 'no' value if needed.
More info:
http://docs.guzzlephp.org/en/stable/request-options.html#proxy
This commit will add support for a new config 'proxyexclude', which
takes a list of host names to be excluded.
It will also provide 'proxy' request option as an array instead of a
string to Guzzle, and populate 'http' and 'https' URI schemes with
proxy URI, and 'no' with 'proxyexclude' list.
Also, if no 'proxy' is configured, it will leave out 'proxy' request
option, so it won't override Guzzle default values.
Sample config file includes a hint on how to explicitly sync
'proxyexclude' with NO_PROXY, and a note about default values.
Signed-off-by: Mohammed Abdellatif <m.latief@gmail.com>
instead of first creating an empty file and then writing the content.
This solves the overhead of creating an empty file with the common pattern:
```php
$file = $simpleFilder->newFile('foo.txt');
$file->putContent('bar.txt');
```
roughly halving the number of storage and database operations that need to be done when creating a `SimpleFile`.
This is not automatically done with `File` because that has a more complex api which I'm more hesitant to touch.
Instead the `Folder::newFile` api has been extended to accept the content for the new file.
In my local testing, the overhead of first creating an empty file took about 20% of the time for preview generation
Signed-off-by: Robin Appelman <robin@icewind.nl>
"button, textarea, select, div[contenteditable='true']" were removed and
"audio, canvas, embed, iframe" were added.
Note that this is a coarse-grained list; according to the spec some of
the elements, like canvas or input, might be treated as a replaced
element in some cases and as ordinary elements in others:
https://html.spec.whatwg.org/multipage/rendering.html#replaced-elements
For now all the elements that might be replaced elements use the loading
image by default, so apps will need to override that when the elements
are treated as ordinary elements. Of course that can be flipped in the
future to instead make an element to use the "::after" approach by
default if it is found that the element requires the override often.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Replaced elements do not have "::after" nor "::before" pseudo-elements,
so the regular loading icon needs to be shown using a background image
instead of the default "::after" pseudo-element approach. However, the
CSS rules were not applied on the replaced elements themselves, but on
their descendants. As the descendants might have support for
pseudo-elements the rules were fixed to be applied on the replaced
elements, and only on the replaced elements.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>