When using OctaneHandler with serverless it parses Content-Disposition: form-data incorrectly
When using OctaneHandler with serverless it parses "Content-Disposition: form-data" incorrectly, specifically in arrays like:
references[0][openalex_id]: 4390954279
references[0][url]:
references[1][openalex_id]: 4313323164
references[1][url]:
references[2][openalex_id]:
references[2][url]: https://theedgemalaysia.com/node/745911
It parses into separate array objects:
{
"references":
[
{
"openalex_id": "4390954279"
},
{
"url": ""
},
{
"openalex_id": "4313323164"
},
{
"url": ""
},
{
"openalex_id": ""
},
{
"url": "https://theedgemalaysia.com/node/745911"
}
]
}
But it should parse into:
{
"references":
[
{
"openalex_id": "4390954279",
"url": ""
},
{
"openalex_id": "4313323164",
"url": ""
},
{
"openalex_id": "",
"url": "https://theedgemalaysia.com/node/745911"
}
],
}
Also any way I can run bref with OctaneHandler locally with docker, so I can debug it further? Currently I setup Octane with frankenphp image.
I think you might want to look directly into this Bref class: https://github.com/brefphp/bref/blob/master/src/Event/Http/Psr7Bridge.php#L112-L135
You could try to first add a test case for this, maybe it's easy to reproduce with a single test directly?
@mnapoli Thanks, I added a pull request https://github.com/brefphp/bref/pull/2010