formpost middleware boundary woes

Asked by Michael Scott Hertzberg

This is an interesting problem that I've been trying to debug myself as a non-devops, front-end person. To give the pre-req, we have a Swift cluster + Keystone auth.

We're using TempURL and FormPost middleware so we can do client side, javascript uploads. When sending data to Swift though with the appropriately generated HMAC-SHA1, it stores in Swift with the exception of the form boundaries not being split and getting storied within the file... so we're ending up with a jpeg as an example, but injected into that is the form post data:

------WebKitFormBoundarySBRC6bOzDDB7OBdX
Content-Disposition: form-data; name="signature"

c1ff8c2265714fe056c7f52a99815f111a583dd2
------WebKitFormBoundarySBRC6bOzDDB7OBdX
Content-Disposition: form-data; name="expires"

1370538745441
------WebKitFormBoundarySBRC6bOzDDB7OBdX
Content-Disposition: form-data; name="max_file_size"

99999999
------WebKitFormBoundarySBRC6bOzDDB7OBdX
Content-Disposition: form-data; name="max_file_count"

10
------WebKitFormBoundarySBRC6bOzDDB7OBdX
Content-Disposition: form-data; name="redirect"

/#
------WebKitFormBoundarySBRC6bOzDDB7OBdX
Content-Disposition: form-data; name="files[]"; filename="a.jpeg"
Content-Type: image/jpeg

ˇÿˇ‡JFIFˇ·ÄExifII*12òÇ"9iá\ÜPicasa¬© Art Gallery of South Australiaê0220††‘‹(‰îHHˇÿˇ‡JFIFˇ€C
[... more fun image bin data ...]
------WebKitFormBoundarySBRC6bOzDDB7OBdX--

Butttttttt whyyyyyyyyy? /var/log/syslog doesn't seem to give much detail on it. Here's the actual post occurring in browser:

http://pastebin.com/GtzLBQYv

Obviously a third-party can't troubleshoot if I'm missing information, so do request anything, and I'll reply. To sum it all up, shouldn't the formpost middleware be splitting those boundaries rather than leaving it/injecting it int the Swift object?

Thanks...

Question information

Language:
English Edit question
Status:
Solved
For:
OpenStack Object Storage (swift) Edit question
Assignee:
No assignee Edit question
Solved by:
Michael Scott Hertzberg
Solved:
Last query:
Last reply:
Revision history for this message
Mike Barton (redbo) said :
#1

> Request Method:PUT
> X-Auth-Token:MIIGGwYJKoZIhvcNAQcCoI.....

I'm confused as to why/how a browser is sending a form submission using a
PUT method and an X-Auth-Token header. But I'd guess your problem lies in
that direction.

-- Mike

On Thu, Jun 6, 2013 at 12:31 PM, Michael Scott Hertzberg <
<email address hidden>> wrote:

> New question #230333 on OpenStack Object Storage (swift):
> https://answers.launchpad.net/swift/+question/230333
>
> This is an interesting problem that I've been trying to debug myself as a
> non-devops, front-end person. To give the pre-req, we have a Swift cluster
> + Keystone auth.
>
> We're using TempURL and FormPost middleware so we can do client side,
> javascript uploads. When sending data to Swift though with the
> appropriately generated HMAC-SHA1, it stores in Swift with the exception of
> the form boundaries not being split and getting storied within the file...
> so we're ending up with a jpeg as an example, but injected into that is the
> form post data:
>
> ------WebKitFormBoundarySBRC6bOzDDB7OBdX
> Content-Disposition: form-data; name="signature"
>
> c1ff8c2265714fe056c7f52a99815f111a583dd2
> ------WebKitFormBoundarySBRC6bOzDDB7OBdX
> Content-Disposition: form-data; name="expires"
>
> 1370538745441
> ------WebKitFormBoundarySBRC6bOzDDB7OBdX
> Content-Disposition: form-data; name="max_file_size"
>
> 99999999
> ------WebKitFormBoundarySBRC6bOzDDB7OBdX
> Content-Disposition: form-data; name="max_file_count"
>
> 10
> ------WebKitFormBoundarySBRC6bOzDDB7OBdX
> Content-Disposition: form-data; name="redirect"
>
> /#
> ------WebKitFormBoundarySBRC6bOzDDB7OBdX
> Content-Disposition: form-data; name="files[]"; filename="a.jpeg"
> Content-Type: image/jpeg
>
> ˇÿˇ‡ JFIF ˇ· ÄExifII* 1 2òÇ "9iá \ÜPicasa¬© Art Gallery of South
> Australia ê 0220 † † ‘ ‹( ‰ î H H ˇÿˇ‡ JFIF
> ˇ€C
> [... more fun image bin data ...]
> ------WebKitFormBoundarySBRC6bOzDDB7OBdX--
>
> Butttttttt whyyyyyyyyy? /var/log/syslog doesn't seem to give much detail
> on it. Here's the actual post occurring in browser:
>
> http://pastebin.com/GtzLBQYv
>
> Obviously a third-party can't troubleshoot if I'm missing information, so
> do request anything, and I'll reply. To sum it all up, shouldn't the
> formpost middleware be splitting those boundaries rather than leaving
> it/injecting it int the Swift object?
>
> Thanks...
>
> --
> You received this question notification because you are a member of
> Swift Core, which is an answer contact for OpenStack Object Storage
> (swift).
>

Revision history for this message
Michael Scott Hertzberg (mshertzberg) said :
#2

welp, you saved the day. I didn't even realize that I had it set as PUT. sigh. thank you Mike.