Skip to content

Commit

Permalink
Fix core XcontentFactory refactor (opensearch-project#732)
Browse files Browse the repository at this point in the history
Signed-off-by: Hailong Cui <[email protected]>
(cherry picked from commit 216dfcb)
  • Loading branch information
Hailong-am committed Aug 7, 2023
1 parent 74de360 commit 60af873
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import org.apache.http.impl.client.DefaultHttpRequestRetryHandler
import org.apache.http.impl.client.HttpClientBuilder
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager
import org.apache.http.util.EntityUtils
import org.opensearch.common.xcontent.XContentFactory
import org.opensearch.common.xcontent.XContentType
import org.opensearch.core.rest.RestStatus
import org.opensearch.core.xcontent.MediaTypeRegistry
import org.opensearch.notifications.core.setting.PluginSettings
import org.opensearch.notifications.core.utils.OpenForTesting
import org.opensearch.notifications.core.utils.logger
Expand Down Expand Up @@ -155,7 +155,7 @@ class DestinationHttpClient {
}

fun buildRequestBody(destination: WebhookDestination, message: MessageContent): String {
val builder = XContentFactory.contentBuilder(XContentType.JSON)
val builder = MediaTypeRegistry.contentBuilder(XContentType.JSON)
val keyName = when (destination) {
// Slack webhook request body has required "text" as key name https://api.slack.com/messaging/webhooks
// Chime webhook request body has required "Content" as key name
Expand Down

0 comments on commit 60af873

Please sign in to comment.