• Brad Fitzpatrick's avatar
    mime/multipart: fix handling of empty parts without CRLF before next part · e393a829
    Brad Fitzpatrick authored
    Empty parts can be either of the form:
    
    a) "--separator\r\n", header (w/ trailing 2xCRLF), \r\n "--separator"...
    or
    b) "--separator\r\n", header (w/ trailing 2xCRLF), "--separator"...
    
    We never handled case b).  In fact the RFC seems kinda vague about
    it, but browsers seem to do a), and App Engine's synthetic POST
    bodies after blob uploads is of form b).
    
    So handle them both, and add a bunch of tests.
    
    (I can't promise these are the last fixes to multipart, especially
    considering its history, but I'm growing increasingly confident at
    least, and I've never submitted a multipart CL with known bugs
    outstanding, including this time.)
    
    R=golang-dev, adg
    CC=golang-dev
    https://golang.org/cl/6212046
    e393a829
Name
Last commit
Last update
..
testdata Loading commit data...
formdata.go Loading commit data...
formdata_test.go Loading commit data...
multipart.go Loading commit data...
multipart_test.go Loading commit data...
writer.go Loading commit data...
writer_test.go Loading commit data...