Skip to content

Add control of what HTTP Request method AbstractFileResolvingResource methods exists, lastModified and lastModified uses on http url resources [SPR-11320] #15944

@spring-projects-issues

Description

@spring-projects-issues

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

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)status: backportedAn issue that has been backported to maintenance branchestype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions