Skip to content

Commit 521ad9f

Browse files
committed
fix: reject content-type header for empty body requests
1 parent 8dec179 commit 521ad9f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/HttpBindingProtocolGenerator.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1868,7 +1868,7 @@ private void handleContentType(
18681868
if (optionalContentType.isPresent() || operation.getInput().isPresent()) {
18691869
String contentType = optionalContentType.orElse(getDocumentContentType());
18701870
// If the operation accepts a content type, it must be either unset or the expected value.
1871-
writer.openBlock("if (contentType !== undefined && contentType !== $S) {", "};", contentType, () -> {
1871+
writer.openBlock("if (contentType !== undefined) {", "};", contentType, () -> {
18721872
writer.write("throw new __UnsupportedMediaTypeException();");
18731873
});
18741874
} else {

0 commit comments

Comments
 (0)