Skip to content

Commit 3abb346

Browse files
authored
provisional: Attachments now uses base64 padding not raw mode (#629)
* corrected base64 encoding of attachments to use padding as that's what cuke JVM does
1 parent 9558224 commit 3abb346

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

internal/formatters/fmt_cucumber.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ func (f *Cuke) buildCukeStep(pickle *messages.Pickle, stepResult models.PickleSt
308308
for _, a := range stepResult.Attachments {
309309
attachments = append(attachments, cukeEmbedding{
310310
Name: a.Name,
311-
Data: base64.RawStdEncoding.EncodeToString(a.Data),
311+
Data: base64.StdEncoding.EncodeToString(a.Data),
312312
MimeType: a.MimeType,
313313
})
314314
}

internal/formatters/formatter-tests/cucumber/scenario_with_attachment

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@
3030
{
3131
"name": "TheFilename1",
3232
"mime_type": "text/plain",
33-
"data": "VGhlRGF0YTE"
33+
"data": "VGhlRGF0YTE="
3434
},
3535
{
3636
"name": "TheFilename2",
3737
"mime_type": "text/plain",
38-
"data": "VGhlRGF0YTI"
38+
"data": "VGhlRGF0YTI="
3939
}
4040
]
4141
},
@@ -54,12 +54,12 @@
5454
{
5555
"name": "TheFilename1",
5656
"mime_type": "text/plain",
57-
"data": "VGhlRGF0YTE"
57+
"data": "VGhlRGF0YTE="
5858
},
5959
{
6060
"name": "TheFilename2",
6161
"mime_type": "text/plain",
62-
"data": "VGhlRGF0YTI"
62+
"data": "VGhlRGF0YTI="
6363
}
6464
]
6565
}

0 commit comments

Comments
 (0)