XenForo
Administrative
- Thread starter
- Admin
- #1
Ran into an issue where a proxy system would throw an invalid content type error. It turns out it's because the contentType() method is doing a regex on what it considers a valid content type like so:
PHP:
A Content-Type header can in fact also have a semi-colon with additional info (which was causing the problem for me). To work around it, I ended up...
Read more
ادامه مطلب...
PHP:
Code:
if (!preg_match('#^[a-zA-Z0-9]+/[a-zA-Z0-9-+]+$#', $contentType))
{
throw new \InvalidArgumentException('Invalid content type');
}
A Content-Type header can in fact also have a semi-colon with additional info (which was causing the problem for me). To work around it, I ended up...
Read more
ادامه مطلب...