From talking with Andrew on IRC, it looks like it'd be easier to add a second backend port served by another twisted.web class, rather than trying to rejig the upload protocol to handle a download verb too.
This second one could handle requests as simple as:
C: GET /$content_id HTTP/1.1
C:
S: 200 Ok HTTP/1.1
S: Content-Type: application/octet-stream
S: Content-Length: xxx
S:
S: ...
It can then look up the content ID directly in its store and serve it. As no alias ID is involved, the server can not know what the mime type is, so I've used "application/octet-stream" above.
From talking with Andrew on IRC, it looks like it'd be easier to add a second backend port served by another twisted.web class, rather than trying to rejig the upload protocol to handle a download verb too.
This second one could handle requests as simple as:
C: GET /$content_id HTTP/1.1 octet-stream
C:
S: 200 Ok HTTP/1.1
S: Content-Type: application/
S: Content-Length: xxx
S:
S: ...
It can then look up the content ID directly in its store and serve it. As no alias ID is involved, the server can not know what the mime type is, so I've used "application/ octet-stream" above.