{"record":{"id":"881b37a062552286","repo":"influxdata/influxdb","slug":"invalid-mime-type-0-http","errorCode":null,"errorMessage":"invalid mime type ({0})","messagePattern":"invalid mime type \\((.+?)\\)","errorType":"http","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"influxdb3_server/src/http.rs","lineNumber":231,"sourceCode":"    InvalidContentEncoding(String),\n\n    /// The specified `Content-Type` is not acceptable.\n    #[error(\"unacceptable content-type, expected: {expected}\")]\n    InvalidContentType { expected: mime::Mime },\n\n    /// The client disconnected.\n    #[error(\"client disconnected\")]\n    ClientHangup(Box<dyn std::error::Error + Send + Sync>),\n\n    /// The client sent a request body that exceeds the configured maximum.\n    #[error(\"max request size ({0} bytes) exceeded\")]\n    RequestSizeExceeded(usize),\n\n    /// Decoding a gzip-compressed stream of data failed.\n    #[error(\"error decoding gzip stream: {0}\")]\n    InvalidGzip(std::io::Error),\n\n    #[error(\"invalid mime type ({0})\")]\n    InvalidMimeType(String),\n\n    /// DatabaseName validation error.\n    #[error(\"error validating database name: {0}\")]\n    InvalidDatabaseName(#[from] DatabaseNameError),\n\n    /// Failure to decode the provided line protocol.\n    #[error(\"failed to parse line protocol: {0}\")]\n    ParseLineProtocol(influxdb_line_protocol::Error),\n\n    /// The router is currently servicing the maximum permitted number of\n    /// simultaneous requests.\n    #[error(\"this service is overloaded, please try again later\")]\n    RequestLimit,\n\n    /// The request has no authentication, but authorization is configured.\n    #[error(\"authentication required\")]\n    Unauthenticated,","sourceCodeStart":213,"sourceCodeEnd":249,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_server/src/http.rs#L213-L249","documentation":"`Error::InvalidMimeType` is returned when a MIME type string supplied with the request (typically the Content-Type value) cannot be parsed into a valid `mime::Mime`. Unlike the NonUtf8 header errors, the string is readable but malformed as a media type.","triggerScenarios":"Passing Content-Type values like \"text\", \"plain-text/lp; ;\", or other strings that fail MIME parsing; the offending value is embedded in the message.","commonSituations":"Hand-typed or interpolated Content-Type headers with typos, missing subtype (\"application\"), stray semicolons/parameters, or clients constructing the header from user configuration.","solutions":["Use a well-formed media type string such as \"text/plain\", \"application/json\", or \"application/vnd.influxdb.v3+csv\"","Validate the configured content type in your client with a MIME parser before sending","Remove stray parameters/whitespace/semicolons from the header value","Let your HTTP library set the default Content-Type instead of overriding it with a custom string"],"exampleFix":"// before\nheaders.set('Content-Type', 'text');\n// after\nheaders.set('Content-Type', 'text/plain');","handlingStrategy":"validation","validationCode":"const MIME_RE = /^[\\w.+-]+\\/[\\w.+-]+(\\s*;.*)?$/;\nif (!MIME_RE.test(contentType)) throw new Error('malformed content-type: ' + contentType);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only use well-known media-type strings for Content-Type","Validate MIME strings with a parser before configuring clients","Avoid interpolating user/config values into Content-Type","Prefer library defaults over hand-built header strings"],"tags":["http","mime","content-type"],"backgroundTag":"invalid-argument-format","analyzedSha":"06200ef96ba82c5f6727e5038a83af8e722c6875","analyzedAt":"2026-09-19T12:55:30.003Z","contentChangedAt":"2026-09-19T12:55:30.003Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}