Skip to content

Commit

Permalink
Fixes to accept media exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
Stardog committed Aug 23, 2017
1 parent ad40763 commit 794b5f1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src-phpws2/src/Http/Accept.php
Expand Up @@ -30,7 +30,7 @@ public function __construct($acceptStr)
$this->mediaRanges = array();
foreach(explode(',', $acceptStr) as $mediaRange) {
$acceptParams = explode(';', $mediaRange);
$contentType = array_shift($acceptParams);
$contentType = trim(array_shift($acceptParams));
$priority = -1.0;
$params = array();

Expand Down
7 changes: 6 additions & 1 deletion src-phpws2/src/Http/AcceptMediaRange.php
Expand Up @@ -21,7 +21,12 @@ class AcceptMediaRange

public function __construct($contentType, $priority, $params)
{
list($this->type, $this->subtype) = explode(self::TYPESEP, $contentType);
if ($contentType !== self::WILDCARD) {
list($this->type, $this->subtype) = explode(self::TYPESEP, $contentType);
} else {
$this->type = self::WILDCARD;
$this->subtype = self::WILDCARD;
}
$this->priority = $priority;
$this->params = $params;
}
Expand Down

0 comments on commit 794b5f1

Please sign in to comment.