From 391660c93b63d3bf1253ef22ed03e1475c870856 Mon Sep 17 00:00:00 2001
From: Olav Morken <olav.morken@uninett.no>
Date: Fri, 26 Mar 2010 13:00:21 +0000
Subject: [PATCH] metaedit: Fix endpoint generation.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@2240 44740490-163a-0410-bde0-09ae8108e29a
---
 modules/metaedit/lib/MetaEditor.php | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/metaedit/lib/MetaEditor.php b/modules/metaedit/lib/MetaEditor.php
index 161cbbb7b..f3817390d 100644
--- a/modules/metaedit/lib/MetaEditor.php
+++ b/modules/metaedit/lib/MetaEditor.php
@@ -18,9 +18,9 @@ class sspmod_metaedit_MetaEditor {
 		}
 	}
 	
-	protected function getEndpointField($request, &$metadata, $key) {
+	protected function getEndpointField($request, &$metadata, $key, $binding) {
 		if (array_key_exists('field_' . $key, $request)) {
-			$e = array('Binding' => SAML2_Const::BINDING_HTTP_REDIRECT, 'Location' => $request['field_' . $key], 'index' => '0');
+			$e = array(array('Binding' => $binding, 'Location' => $request['field_' . $key], 'index' => '0'));
 			$metadata[$key] = $e;
 		} else {
 			if (isset($metadata[$key])) unset($metadata[$key]);
@@ -31,8 +31,8 @@ class sspmod_metaedit_MetaEditor {
 		$this->getStandardField($request, $metadata, 'entityid');
 		$this->getStandardField($request, $metadata, 'name');
 		$this->getStandardField($request, $metadata, 'description');
-		$this->getEndpointField($request, $metadata, 'AssertionConsumerService');
-		$this->getEndpointField($request, $metadata, 'SingleLogoutService');
+		$this->getEndpointField($request, $metadata, 'AssertionConsumerService', SAML2_Const::BINDING_HTTP_POST);
+		$this->getEndpointField($request, $metadata, 'SingleLogoutService', SAML2_Const::BINDING_HTTP_REDIRECT);
 		// $this->getStandardField($request, $metadata, 'certFingerprint');
 		$metadata['updated'] = time();
 		
-- 
GitLab