leafsphp / http

📡 Leaf Http module
https://leafphp.dev/modules/http/
7 stars 9 forks source link

Fixed Content-Type json UTF-8 #8

Closed jeis4n closed 1 year ago

jeis4n commented 1 year ago

If Content-Type is 'application/json; charset=UTF-8' then it doesn't recognize it as json.

Description

Related Issue

jeis4n commented 1 year ago

This is another way to validate it, but it needs to be tested (including performance):

preg_match('/application\/json|multipart\/form-data/i', Headers::get('Content-Type'))
mychidarko commented 1 year ago

Hey @jeis4n thanks for opening this. Looks good to me, but I'll check the preg_match approach too.

jeis4n commented 1 year ago

With pleasure!