laravel-bridge icon indicating copy to clipboard operation
laravel-bridge copied to clipboard

When using OctaneHandler with serverless it parses Content-Disposition: form-data incorrectly

Open vedmant opened this issue 2 months ago • 2 comments

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.

vedmant avatar Oct 21 '25 07:10 vedmant

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 avatar Oct 21 '25 08:10 mnapoli

@mnapoli Thanks, I added a pull request https://github.com/brefphp/bref/pull/2010

vedmant avatar Oct 21 '25 10:10 vedmant