Comment 5 for bug 620458

Revision history for this message
Francis J. Lacoste (flacoste) wrote :

The easiest way to patch this is to override the behavior of the LibraryBackedByteStorage alias_url property for BugAttachment.

To do so, we should create a new AttachmentField extending Bytes which provide an IAttachementField interface and register a subclass of LibraryBackedByteStorage as its IByteStorage implementation.

(See lib/canonical/launchpad/zcml/webservice.zcml for the existing registration)

The alias_url property should return a URL to the attachment on the web service host for private attachment.
 (We cannot point at the normal web site, since the launchpadlib client won't know how to authenticate their.) Public attachment should use the normal librarian URL.

We should declare that StreamOrRedirectFileAliasView provides IHTTPResource so that the view can work on the web service host.