Skip to content

Commit

Permalink
Update ContentType.php
Browse files Browse the repository at this point in the history
To be able to cope with mimetype like type/*

Signed-off-by: tomolimo <[email protected]>
  • Loading branch information
tomolimo authored May 31, 2024
1 parent 6d1c33d commit 4da8cb0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Header/ContentType.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public function toString()
*/
public function setType($type)
{
if (! preg_match('/^[a-z-]+\/[a-z0-9.+-]+$/i', $type)) {
if (! preg_match('/^[a-z-]+\/[\*a-z0-9.+-]+$/i', $type)) {
throw new Exception\InvalidArgumentException(sprintf(
'%s expects a value in the format "type/subtype"; received "%s"',
__METHOD__,
Expand Down

0 comments on commit 4da8cb0

Please sign in to comment.