Inline chat moderation request returning 500s (#4412)
* Initial plan * Initial analysis of inline chat moderation 500 error issue Co-authored-by: gabek <414923+gabek@users.noreply.github.com> * Fix inline chat moderation 500 errors by supporting Authorization header tokens - Modified RequireUserModerationScopeAccesstoken middleware to check both Authorization header (Bearer tokens) and URL query parameters - This fixes the issue where inline chat moderation from the web UI was failing with 500 errors - Maintains backward compatibility with existing code that uses query parameter tokens - The fix aligns the chat endpoint behavior with the integrations endpoint which already supported Bearer tokens Addresses the wiring issue between OpenAPI spec and API implementation identified in issue comments. Co-authored-by: gabek <414923+gabek@users.noreply.github.com> * Fix inline chat moderation 500 errors by adding nil pointer checks Co-authored-by: gabek <414923+gabek@users.noreply.github.com> * Fix nil pointer vulnerabilities across all OpenAPI endpoints Co-authored-by: gabek <414923+gabek@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: gabek <414923+gabek@users.noreply.github.com>
This commit is contained in:
co-authored by
gabek
copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
parent
12e045300d
commit
149d80a07d
@@ -29,7 +29,12 @@ func ReportPlaybackMetrics(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
clientID := utils.GenerateClientIDFromRequest(r)
|
||||
|
||||
if request.Errors == nil {
|
||||
webutils.WriteSimpleResponse(w, false, "errors field is required")
|
||||
return
|
||||
}
|
||||
metrics.RegisterPlaybackErrorCount(clientID, *request.Errors)
|
||||
|
||||
if request.Bandwidth != nil && *request.Bandwidth != 0.0 {
|
||||
metrics.RegisterPlayerBandwidth(clientID, *request.Bandwidth)
|
||||
}
|
||||
@@ -42,5 +47,9 @@ func ReportPlaybackMetrics(w http.ResponseWriter, r *http.Request) {
|
||||
metrics.RegisterPlayerSegmentDownloadDuration(clientID, *request.DownloadDuration)
|
||||
}
|
||||
|
||||
if request.QualityVariantChanges == nil {
|
||||
webutils.WriteSimpleResponse(w, false, "qualityVariantChanges field is required")
|
||||
return
|
||||
}
|
||||
metrics.RegisterQualityVariantChangesCount(clientID, *request.QualityVariantChanges)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user