Skip to content
Snippets Groups Projects
Commit ed9eebe9 authored by Olav Morken's avatar Olav Morken
Browse files

SAML2_Binding: Proper check for content type.

In r2423, I committed an incomplete fix. This is the proper fix.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@2429 44740490-163a-0410-bde0-09ae8108e29a
parent 7b889244
No related branches found
No related tags found
No related merge requests found
......@@ -61,19 +61,21 @@ abstract class SAML2_Binding {
break;
case 'POST':
if (isset($_SERVER['CONTENT_TYPE'])) {
$contentType = $_SERVER['CONTENT_TYPE'];
$contentType = explode(';', $contentType);
$contentType = $contentType[0]; /* Remove charset. */
} else {
$contentType = NULL;
}
if (array_key_exists('SAMLRequest', $_REQUEST) || array_key_exists('SAMLResponse', $_REQUEST)) {
return new SAML2_HTTPPost();
} elseif (array_key_exists('CONTENT_TYPE', $_SERVER) && substr($_SERVER['CONTENT_TYPE'], 0, 8) === 'text/xml'){
} elseif ($contentType === 'text/xml') {
return new SAML2_SOAP();
}
break;
}
$s = var_export($_SERVER, TRUE);
foreach (explode("\n", $s) as $l) {
error_log($l);
}
throw new Exception('Unable to find the current binding.');
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment