Skip to content

Commit 5506115

Browse files
committed
Emit mixed-case and parse any case user metadata
This allows more jclouds integration tests to pass. References #34.
1 parent 3b17c4f commit 5506115

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/com/bouncestorage/swiftproxy/v1/ObjectResource.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999

100100
@Path("/v1/{account}/{container}/{object:.*}")
101101
public final class ObjectResource extends BlobStoreResource {
102-
private static final String META_HEADER_PREFIX = "x-object-meta-";
102+
private static final String META_HEADER_PREFIX = "X-Object-Meta-";
103103
private static final String DYNAMIC_OBJECT_MANIFEST = "x-object-manifest";
104104
private static final String STATIC_OBJECT_MANIFEST = "x-static-large-object";
105105
private static final Set<String> RESERVED_METADATA = ImmutableSet.of(
@@ -360,9 +360,9 @@ private static String contentType(String contentType) {
360360

361361
private Map<String, String> getUserMetadata(Request request) {
362362
return StreamSupport.stream(request.getHeaderNames().spliterator(), false)
363-
.filter(name -> name.toLowerCase().startsWith(META_HEADER_PREFIX))
363+
.filter(name -> name.toLowerCase().startsWith(META_HEADER_PREFIX.toLowerCase()))
364364
.filter(name -> {
365-
if (name.equals(META_HEADER_PREFIX) || RESERVED_METADATA.contains(name)) {
365+
if (name.equalsIgnoreCase(META_HEADER_PREFIX) || RESERVED_METADATA.contains(name)) {
366366
throw new BadRequestException();
367367
}
368368
return true;

0 commit comments

Comments
 (0)