Skip to content

Commit

Permalink
fix: use html/template for SAML POST/Logout templates (#32)
Browse files Browse the repository at this point in the history
* use html/template for SAML POST/Logout templates

* fix: xml html header breaks in post/logoutTemplate when using html/template
  • Loading branch information
coelho authored Nov 2, 2022
1 parent 80e4820 commit e9cc5c7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pkg/provider/identityprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"io"
"net/http"
"reflect"
"text/template"
"html/template"
"time"

"github.com/zitadel/saml/pkg/provider/serviceprovider"
Expand Down
2 changes: 1 addition & 1 deletion pkg/provider/logout_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"encoding/base64"
"encoding/xml"
"net/http"
"text/template"
"html/template"
"time"

"github.com/zitadel/saml/pkg/provider/xml/saml"
Expand Down
2 changes: 1 addition & 1 deletion pkg/provider/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/base64"
"fmt"
"net/http"
"text/template"
"html/template"
"time"

"github.com/zitadel/saml/pkg/provider/xml"
Expand Down
4 changes: 2 additions & 2 deletions pkg/provider/template.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package provider

const postTemplate = `<?xml version="1.0" encoding="UTF-8"?>
const postTemplate = `
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
Expand All @@ -27,7 +27,7 @@ value="{{ .SAMLResponse }}"/>
</body>
</html>`

const logoutTemplate = `<?xml version="1.0" encoding="UTF-8"?>
const logoutTemplate = `
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
Expand Down

0 comments on commit e9cc5c7

Please sign in to comment.