Skip to content

Commit

Permalink
fix: add content type on schedule segment api (#592)
Browse files Browse the repository at this point in the history
  • Loading branch information
iProdigy committed Jul 6, 2022
1 parent bec475b commit 7b9e2e6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Expand Up @@ -1757,7 +1757,10 @@ HystrixCommand<Void> updateChannelStreamSchedule(
* @return StreamScheduleResponse
*/
@RequestLine("POST /schedule/segment?broadcaster_id={broadcaster_id}")
@Headers("Authorization: Bearer {token}")
@Headers({
"Authorization: Bearer {token}",
"Content-Type: application/json"
})
HystrixCommand<StreamScheduleResponse> createStreamScheduleSegment(
@Param("token") String authToken,
@Param("broadcaster_id") String broadcasterId,
Expand All @@ -1774,7 +1777,10 @@ HystrixCommand<StreamScheduleResponse> createStreamScheduleSegment(
* @return StreamScheduleResponse
*/
@RequestLine("PATCH /schedule/segment?broadcaster_id={broadcaster_id}&id={id}")
@Headers("Authorization: Bearer {token}")
@Headers({
"Authorization: Bearer {token}",
"Content-Type: application/json"
})
HystrixCommand<StreamScheduleResponse> updateStreamScheduleSegment(
@Param("token") String authToken,
@Param("broadcaster_id") String broadcasterId,
Expand Down Expand Up @@ -2402,7 +2408,7 @@ HystrixCommand<WebhookSubscriptionList> getWebhookSubscriptions(
* @deprecated <a href="https://discuss.dev.twitch.tv/t/deprecation-of-websub-based-webhooks/32152">Will be decommissioned after 2021-09-16 in favor of EventSub</a>
*/
@RequestLine("POST /webhooks/hub")
@Headers({"Authorization: Bearer {token}", "content-type: application/json"})
@Headers({"Authorization: Bearer {token}", "Content-Type: application/json"})
@Deprecated
HystrixCommand<Response> requestWebhookSubscription(
WebhookRequest request, // POJO as first arg is assumed by feign to be body if no @Body annotation
Expand Down
Expand Up @@ -68,6 +68,8 @@ public void apply(RequestTemplate template) {
if (!template.headers().containsKey("Client-Id"))
template.header("Client-Id", clientId);
template.header("User-Agent", userAgent);
if (template.body() != null && !template.headers().containsKey("Content-Type"))
template.header("Content-Type", "application/json");
}

}

0 comments on commit 7b9e2e6

Please sign in to comment.