{"record":{"id":"32c01a2a9754c2cc","repo":"AlexxIT/go2rtc","slug":"wrong-content-type","errorCode":null,"errorMessage":"wrong content type","messagePattern":"wrong content type","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/rtsp/server.go","lineNumber":83,"sourceCode":"\t\t}\n\n\t\t// Receiver: OPTIONS > DESCRIBE > SETUP... > PLAY > TEARDOWN\n\t\t// Sender: OPTIONS > ANNOUNCE > SETUP... > RECORD > TEARDOWN\n\t\tswitch req.Method {\n\t\tcase MethodOptions:\n\t\t\tres := &tcp.Response{\n\t\t\t\tHeader: map[string][]string{\n\t\t\t\t\t\"Public\": {\"OPTIONS, SETUP, TEARDOWN, DESCRIBE, PLAY, PAUSE, ANNOUNCE, RECORD\"},\n\t\t\t\t},\n\t\t\t\tRequest: req,\n\t\t\t}\n\t\t\tif err = c.WriteResponse(res); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase MethodAnnounce:\n\t\t\tif req.Header.Get(\"Content-Type\") != \"application/sdp\" {\n\t\t\t\treturn errors.New(\"wrong content type\")\n\t\t\t}\n\n\t\t\tc.SDP = string(req.Body) // for info\n\n\t\t\tc.Medias, err = UnmarshalSDP(req.Body)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\t// TODO: fix someday...\n\t\t\tfor i, media := range c.Medias {\n\t\t\t\ttrack := core.NewReceiver(media, media.Codecs[0])\n\t\t\t\ttrack.ID = byte(i * 2)\n\t\t\t\tc.Receivers = append(c.Receivers, track)\n\t\t\t}\n\n\t\t\tc.mode = core.ModePassiveProducer\n\t\t\tc.Fire(MethodAnnounce)","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/AlexxIT/go2rtc/blob/c245815e75e2a5fd60b4290f12bfc04e55a984d3/pkg/rtsp/server.go#L65-L101","documentation":"RTSP server Accept guard: an ANNOUNCE request arrived whose Content-Type is not 'application/sdp'. The SDP describing the tracks to record cannot be trusted from a non-SDP body, so the announce is rejected before c.SDP is set.","triggerScenarios":"Thrown at pkg/rtsp/server.go:83 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the publishing client to send Content-Type: application/sdp with ANNOUNCE","Check for proxy/Middleware stripping or rewriting the header","Verify the client speaks RTSP push, not RTMP/HTTP put"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c245815e75e2a5fd60b4290f12bfc04e55a984d3","analyzedAt":"2026-09-07T11:47:02.965Z","contentChangedAt":"2026-09-07T11:47:02.965Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}