Repository navigation
Description
👟 Reproduction steps
Use a valid project and an API key with the executions.write scope. Send a raw REST request to POST /v1/functions/{functionId}/executions with:
{
"headers": {
"X-Test": ["bad"]
}
}The response is HTTP 500:
{
"message": "Server Error",
"code": 500,
"type": "general_unknown"
}The API log confirms:
TypeError: strlen(): Argument #1 ($string) must be of type string, array given
As a control, this body also returned HTTP 500, even though the header validator correctly rejects the name:
{
"headers": {
"bad/name": "value"
}
}👍 Expected behavior
Both requests should be rejected with HTTP 400 and a useful invalid-headers message.
👎 Actual Behavior
The route's JSONObject validator accepts the shape of the headers object without checking each value's type. Appwrite\Functions\Validator\Headers::isValid() then calls strlen($val ?? '') on the array value (Headers.php:63) and throws a TypeError.
For an invalid header name, Headers::isValid() returns false, but the route calls (Executions/Create.php:169):
throw new Exception($validator->getDescription(), 400);Appwrite\Extend\Exception expects an error type as its first argument and a message as its second, as the datetime check a few lines above does. Here the description is passed as the type and 400 as the message, so the HTTP code is never set and this path also produces a server error.
🎲 Appwrite version
Different version (specify in environment)
💻 Operating system
Linux
🧱 Your Environment
Self-hosted local Docker Compose development build from upstream/main. GET /v1/health/version reported 2.3.0. Linux host. I sent the request directly to the local API using a valid project and API key; no Appwrite SDK was used.
👀 Have you spent some time to check if this issue has been raised before?
- I checked and didn't find similar issue
🏢 Have you read the Code of Conduct?
- I have read the Code of Conduct
Activity
Indra55 commentedon Sep 28, 2026
I'd like to work on this. Plan: add a string/null check in Headers::isValid() and throw GENERAL_ARGUMENT_INVALID from the route, with tests. Could I be assigned?
fix(functions): return 400 for malformed execution headers
fix(functions): return 400 for malformed execution headers