From c5edd7f572d52ca5021fbef71876cc2044138709 Mon Sep 17 00:00:00 2001 From: Nirmal N R Date: Fri, 19 Sep 2025 17:12:17 +0530 Subject: [PATCH] feat(router): add excludeAction option for URL routing - Add ExcludeAction field to target struct in routing configuration - When excludeAction is true, skip appending action to URL path - Provides flexibility for routing scenarios where action should not be part of URL path - Maintains backward compatibility by defaulting to existing behavior This change allows routing rules to be configured with excludeAction: true when the target URL should not have the action appended to its path. --- pkg/plugin/implementation/router/router.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/plugin/implementation/router/router.go b/pkg/plugin/implementation/router/router.go index 9ed23ce..d469975 100644 --- a/pkg/plugin/implementation/router/router.go +++ b/pkg/plugin/implementation/router/router.go @@ -42,6 +42,7 @@ type routingRule struct { type target struct { URL string `yaml:"url,omitempty"` // URL for "url" or gateway endpoint for "bpp"/"bap" PublisherID string `yaml:"publisherId,omitempty"` // For "msgq" type + ExcludeAction bool `yaml:"excludeAction,omitempty"` // For "url" type to exclude appending action to URL path } // TargetType defines possible target destinations. @@ -115,7 +116,9 @@ func (r *Router) loadRules(configPath string) error { if err != nil { return fmt.Errorf("invalid URL in rule: %w", err) } - parsedURL.Path = joinPath(parsedURL, endpoint) + if !rule.Target.ExcludeAction { + parsedURL.Path = joinPath(parsedURL, endpoint) + } route = &model.Route{ TargetType: rule.TargetType, URL: parsedURL,