Skip to content

Commit 36d33e1

Browse files
committed
Fix typo
Signed-off-by: Laurent Garnier <[email protected]>
1 parent 95ddef2 commit 36d33e1

File tree

1 file changed

+6
-7
lines changed
  • bundles/org.openhab.core.io.rest.core/src/main/java/org/openhab/core/io/rest/core/internal/fileformat

1 file changed

+6
-7
lines changed

bundles/org.openhab.core.io.rest.core/src/main/java/org/openhab/core/io/rest/core/internal/fileformat/FileFormatResource.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -402,20 +402,19 @@ public Response parse(final @Context HttpHeaders httpHeaders,
402402
@RequestBody(description = "file format syntax", required = true, content = {
403403
@Content(mediaType = "text/vnd.openhab.dsl.thing", schema = @Schema(example = DSL_THINGS_EXAMPLE)),
404404
@Content(mediaType = "application/yaml", schema = @Schema(example = YAML_THINGS_EXAMPLE)) }) String input) {
405-
String contentTypetHeader = httpHeaders.getHeaderString(HttpHeaders.CONTENT_TYPE);
406-
String acceptHeader = httpHeaders.getHeaderString(HttpHeaders.ACCEPT);
407-
logger.debug("transform: contentType = {}, mediaType = {}", contentTypetHeader, acceptHeader);
405+
String contentTypeHeader = httpHeaders.getHeaderString(HttpHeaders.CONTENT_TYPE);
406+
logger.debug("parse: contentType = {}", contentTypeHeader);
408407

409408
// First parse the input
410409
List<Thing> things = new ArrayList<>();
411410
List<String> errors = new ArrayList<>();
412411
List<String> warnings = new ArrayList<>();
413-
ThingFileParser thingParser = getThingFileParser(contentTypetHeader);
414-
switch (contentTypetHeader) {
412+
ThingFileParser thingParser = getThingFileParser(contentTypeHeader);
413+
switch (contentTypeHeader) {
415414
case "text/vnd.openhab.dsl.thing":
416415
if (thingParser == null) {
417416
return Response.status(Response.Status.UNSUPPORTED_MEDIA_TYPE)
418-
.entity("Unsupported content type '" + contentTypetHeader + "'!").build();
417+
.entity("Unsupported content type '" + contentTypeHeader + "'!").build();
419418
} else if (!thingParser.parseFileFormat(input, things, errors, warnings)) {
420419
return Response.status(Response.Status.BAD_REQUEST).entity(String.join("\n", errors)).build();
421420
} else if (things.isEmpty()) {
@@ -429,7 +428,7 @@ public Response parse(final @Context HttpHeaders httpHeaders,
429428
break;
430429
default:
431430
return Response.status(Response.Status.UNSUPPORTED_MEDIA_TYPE)
432-
.entity("Unsupported content type '" + contentTypetHeader + "'!").build();
431+
.entity("Unsupported content type '" + contentTypeHeader + "'!").build();
433432
}
434433

435434
return Response.ok(convertToFileFormatDTO(things, warnings)).build();

0 commit comments

Comments
 (0)