[Catalyst] HTTP::Body(::MultiPart) RFC md5 digests for uploads

Andrew Bramble andrew.bramble at omnilab.com.au
Thu Jun 29 02:59:01 CEST 2006


On Thursday 29 June 2006 08:00, Armin Obersteiner wrote:
> hi!
>
> > It took me some time to track down the fact that HTTP::Body::MultiPart
> > was responsible for the writing of request data chunks to temporary
> > files. Attached is a first try at this which includes
> >  patch HTTP::Body::Multipart to create a Digest::MD5 object and ->add
> > chunks of incoming data to it.
> >  patch Catalyst::Request::Upload to add and accessor for 'md5'
> >  patch &Catalyst::Engine::prepare_uploads to take the upload object(s)
> > from request->{_body}->upload  and create Catalyst::Request::Upload
> > object including the 'md5' attribute.
> >
> > I welcome comments about the sense and usefullness of this :)
>
> looks useful. but i think a generic patch with an "checksum" accessor and
> a config choice of "Digest::MD5", "Digest::SHA1", ... would be better?
>
> can this be done within a plugin too?
>

I agree checksum would be better and more flexible.

Since the responsibility of parsing chunks of the raw request is given to 
HTTP::Body by Catalyst, a plugin in Catalyst namespace would need to override 
a method in HTTP::Body::Multipart and several within Catalyst  . Not sure how 
feasible this is.

As for a config param how about (YAML)

upload:
 - checksum: Digest::MD5




More information about the Catalyst mailing list