diff --git a/lib/SAML2/Binding.php b/lib/SAML2/Binding.php
index b2336ced39507e27fe05ae67e55a98a669b00b74..93c15a56fd354b7129bf49f9216963241e03878c 100644
--- a/lib/SAML2/Binding.php
+++ b/lib/SAML2/Binding.php
@@ -63,12 +63,17 @@ abstract class SAML2_Binding {
 		case 'POST':
 			if (array_key_exists('SAMLRequest', $_REQUEST) || array_key_exists('SAMLResponse', $_REQUEST)) {
 				return new SAML2_HTTPPost();
-			} elseif (array_key_exists('CONTENT_TYPE', $_SERVER) && $_SERVER['CONTENT_TYPE'] === 'text/xml'){
+			} elseif (array_key_exists('CONTENT_TYPE', $_SERVER) && substr($_SERVER['CONTENT_TYPE'], 0, 8) === '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.');
 	}