Add control of what HTTP Request method AbstractFileResolvingResource methods exists, lastModified and lastModified uses on http url resources [SPR-11320] #15944
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
status: backported
An issue that has been backported to maintenance branches
type: enhancement
A general enhancement
Milestone
Lars Bo Spring opened SPR-11320 and commented
We recently upgraded to spring 3.2.4 from 3.0.0 and experienced a change in how UrlResource/AbstractFileResolvingResource work.
When the AbstractFileResolvingResource methods exists(), lastModified() and lastModified() are invoked on HTTP url resources, the http lookups are now performed as HTTP HEAD requests instead of in earlier releases that fetched the entire data.
In most situations this approach is very appropriate and reduces required network traffic.
However some less intelligently behaving remote services return 405 on HEAD requests, requiring that we subclass the resource type or implement it from scratch to avoid calls to the above methods (especially exists()) return an invalid response.
It would be great if it was possible to define what method to use on such requests as a property on AbstractFileResolvingResource alternatively on UrlResource, or to enable the URLResource to use the old way of handling those methods.
Hope this makes sense to you :-)
Affects: 3.2.6, 4.0 GA
Backported to: 3.2.7
The text was updated successfully, but these errors were encountered: