Skip to content

Commit

Permalink
r/application_gateway: conditionally handling both for components
Browse files Browse the repository at this point in the history
  • Loading branch information
tombuildsstuff committed Jan 12, 2024
1 parent 5fcfcfa commit 28dde19
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions internal/services/network/application_gateway_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -3848,6 +3848,7 @@ func flattenApplicationGatewayRewriteRuleSets(input *[]network.ApplicationGatewa
if actionSet.URLConfiguration != nil {
config := *actionSet.URLConfiguration
components := ""

path := ""
if config.ModifiedPath != nil {
path = *config.ModifiedPath
Expand All @@ -3858,12 +3859,17 @@ func flattenApplicationGatewayRewriteRuleSets(input *[]network.ApplicationGatewa
queryString = *config.ModifiedQueryString
}

if path != queryString {
if path != "" && queryString == "" {
components = "path_only"
} else if queryString != "" && path == "" {
components = "query_string_only"
}
// `components` doesn't exist in the API - it appears to be purely a UI state in the Portal
// as such we should consider removing this field in the future.
if path == queryString {
// used to represent `both`
components = ""
}
if config.ModifiedQueryString != nil && config.ModifiedPath == nil {
components = "query_string_only"
}
if config.ModifiedQueryString == nil && config.ModifiedPath != nil {
components = "path_only"
}

reroute := false
Expand Down

0 comments on commit 28dde19

Please sign in to comment.