Skip to content

Commit

Permalink
Add support for application/soap+xml error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
vanny96 authored Oct 3, 2024
1 parent db5d0b6 commit 6deb560
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
3 changes: 3 additions & 0 deletions gateway/handler_error.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ func (e *ErrorHandler) HandleError(w http.ResponseWriter, r *http.Request, errMs
contentType = strings.Split(contentType, ";")[0]

switch contentType {
case header.ApplicationSoapXML:
templateExtension = "xml"
contentType = header.ApplicationSoapXML
case header.ApplicationXML:
templateExtension = "xml"
contentType = header.ApplicationXML
Expand Down
9 changes: 5 additions & 4 deletions header/header.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ const (
)

const (
TykHookshot = "Tyk-Hookshot"
ApplicationJSON = "application/json"
ApplicationXML = "application/xml"
TextXML = "text/xml"
TykHookshot = "Tyk-Hookshot"
ApplicationJSON = "application/json"
ApplicationXML = "application/xml"
ApplicationSoapXML = "application/soap+xml"
TextXML = "text/xml"
)

const (
Expand Down

0 comments on commit 6deb560

Please sign in to comment.