ContentDisposition trims charset in filename
Backport of c8bce9686f
Closes gh-24112
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -71,6 +71,14 @@ public class ContentDispositionTests {
|
||||
.name("foo").filename("foo.txt").size(123L).build(), disposition);
|
||||
}
|
||||
|
||||
@Test // gh-24112
|
||||
public void parseEncodedFilenameWithPaddedCharset() {
|
||||
ContentDisposition disposition = ContentDisposition
|
||||
.parse("attachment; filename*= UTF-8''some-file.zip");
|
||||
assertEquals(ContentDisposition.builder("attachment")
|
||||
.filename("some-file.zip", StandardCharsets.UTF_8).build(), disposition);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void parseEncodedFilename() {
|
||||
ContentDisposition disposition = ContentDisposition
|
||||
|
||||
Reference in New Issue
Block a user