Skip to content

Commit be5e8be

Browse files
committed
make objectmapper plugable
1 parent b3b8b78 commit be5e8be

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ bin/
66
.project
77
.classpath
88

9+
*.iml
910
.idea/
1011
out/
1112

src/main/kotlin/com/github/mduesterhoeft/router/ApiRequest.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,6 @@ package com.github.mduesterhoeft.router
3333
.firstOrNull { it.key.toLowerCase() == httpHeader.toLowerCase() }
3434
?.value
3535
}
36+
37+
public fun getHeader(httpHeader: String) = getHeaderCaseInsensitive(httpHeader)
3638
}

src/main/kotlin/com/github/mduesterhoeft/router/RequestHandler.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import kotlin.reflect.jvm.reflect
1414

1515
abstract class RequestHandler : RequestHandler<ApiRequest, ApiResponse> {
1616

17-
val objectMapper: ObjectMapper = jacksonObjectMapper()
17+
open val objectMapper = jacksonObjectMapper()
1818

1919
override fun handleRequest(input: ApiRequest, context: Context): ApiResponse? {
2020
log.info("handling request with method '${input.httpMethod}' and path '${input.path}' - Accept:${input.acceptHeader} Content-Type:${input.contentType} $input")

0 commit comments

Comments
 (0)