Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add content type on schedule segment api #592

Merged
merged 3 commits into from Jul 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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"))
iProdigy marked this conversation as resolved.
Show resolved Hide resolved
template.header("Content-Type", "application/json");
}

}