{"record":{"id":"4a3d32e66ded61a8","repo":"phalcon/cphalcon","slug":"invalid-header-not-an-array","errorCode":null,"errorMessage":"Invalid Header (not an array)","messagePattern":"Invalid Header \\(not an array\\)","errorType":"exception","errorClass":"InvalidHeader","httpStatus":null,"severity":"error","filePath":"phalcon/Encryption/Security/JWT/Token/Parser.zep","lineNumber":113,"sourceCode":"\n        return new Item(decoded, claims);\n    }\n\n    /**\n     * Decodes the headers\n     *\n     * @param string $headers\n     *\n     * @return Item\n     */\n    private function decodeHeaders(string headers) -> <Item>\n    {\n        var decoded;\n\n        let decoded = this->decode->__invoke(this->doDecodeUrl(headers), true);\n\n        if typeof decoded !== \"array\" {\n            throw new InvalidHeader();\n        }\n\n        if !isset decoded[Enum::TYPE] {\n            throw new MissingJwtTypHeader();\n        }\n\n        return new Item(decoded, headers);\n    }\n\n    /**\n     * Decodes the signature\n     *\n     * @param Item   $headers\n     * @param string $signature\n     *\n     * @return Signature\n     */\n    private function decodeSignature(<Item> headers,  string signature) -> <Signature>","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/phalcon/cphalcon/blob/b7419de9cd0a8a3f48441ead84c9f8415d463e25/phalcon/Encryption/Security/JWT/Token/Parser.zep#L95-L131","documentation":"Thrown by JWT Token Parser::decodeHeaders when base64-decoding and JSON-decoding the header segment does not yield an array. The header part of the token is malformed (not a JSON object). Verify the token's first segment encodes a JSON object.","triggerScenarios":"Thrown at phalcon/Encryption/Security/JWT/Token/Parser.zep:113 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check that the token's first segment decodes to a JSON object","Reject malformed tokens and force the client to obtain a fresh one"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b7419de9cd0a8a3f48441ead84c9f8415d463e25","analyzedAt":"2026-08-21T06:21:18.811Z","contentChangedAt":"2026-08-21T06:21:18.811Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}