dcache icon indicating copy to clipboard operation
dcache copied to clipboard

Enhancement: WebDav: Return 413 instead of 507 if max-upload is exceeded

Open nManger opened this issue 4 months ago • 1 comments

Dear dCache developers,

I have a small, non-urgent enhancement request:

When using the max-upload session parameter of the omnisession plugin, the dCache WebDav-door answers for files larger than the allowed size with the HTTP Status Code 507 Insufficient Storage and the message Insufficient storage: SER_DISK_FULL. This signals to the user that no files can be uploaded because we do not provide the neccesary space, which would lead to questions on the fitness of our service if we deploy this in production.

I think it would be more appropriate for dCache to answer with the HTTP status code 413 Payload Too Large, optionally with a message containing the set value of max-upload for the session. This makes it clear that uploads are possible in principle and the upload failed due to the user trying to upload a file which did not conform to the established parameters.

Kind regards, Natascha Manger

nManger avatar Sep 08 '25 08:09 nManger

Just to add, there's a nice example from MDN that describes a use for 413 status code when the user has exceeded their file upload limit. This seems directly applicable to this scenario in dCache.

Returning 507 (SER_DISK_FULL) is also arguable a bug, since dCache would accept additional data if the individual files were smaller.

paulmillar avatar Sep 08 '25 08:09 paulmillar