-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- We have mixed formats in headers (map of string/list of strings, and map of string/string), we convert all in map of string, string.
- Loading branch information
1 parent
1feab19
commit 39bca78
Showing
3 changed files
with
19 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 11 additions & 2 deletions
13
src/main/kotlin/io/kuzzle/sdk/events/MessageReceivedEvent.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,17 @@ | ||
package io.kuzzle.sdk.events | ||
|
||
import io.ktor.http.* | ||
|
||
data class MessageReceivedEvent( | ||
var message: String?, | ||
var payload: Map<String?, Any?> = emptyMap(), | ||
var status: Int = 200, | ||
var headers: Map<String, List<String>>? = null | ||
) | ||
var headers: Headers? = null | ||
) { | ||
fun getHeadersMap() : Map<String, String> { | ||
if(headers == null) { | ||
return emptyMap() | ||
} | ||
return headers!!.entries().associate { it.key to it.value.first() } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters