2016-01-29 20:53:56 +01:00
|
|
|
package route53
|
|
|
|
|
|
|
|
import (
|
|
|
|
"regexp"
|
|
|
|
|
|
|
|
"github.com/aws/aws-sdk-go/aws/client"
|
|
|
|
"github.com/aws/aws-sdk-go/aws/request"
|
2016-03-18 20:35:09 +01:00
|
|
|
"github.com/aws/aws-sdk-go/private/protocol/restxml"
|
2016-01-29 20:53:56 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
initClient = func(c *client.Client) {
|
|
|
|
c.Handlers.Build.PushBack(sanitizeURL)
|
|
|
|
}
|
2016-03-18 20:35:09 +01:00
|
|
|
|
|
|
|
initRequest = func(r *request.Request) {
|
|
|
|
switch r.Operation.Name {
|
|
|
|
case opChangeResourceRecordSets:
|
|
|
|
r.Handlers.UnmarshalError.Remove(restxml.UnmarshalErrorHandler)
|
|
|
|
r.Handlers.UnmarshalError.PushBack(unmarshalChangeResourceRecordSetsError)
|
|
|
|
}
|
|
|
|
}
|
2016-01-29 20:53:56 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
var reSanitizeURL = regexp.MustCompile(`\/%2F\w+%2F`)
|
|
|
|
|
|
|
|
func sanitizeURL(r *request.Request) {
|
|
|
|
r.HTTPRequest.URL.Opaque =
|
|
|
|
reSanitizeURL.ReplaceAllString(r.HTTPRequest.URL.Opaque, "/")
|
|
|
|
}
|