File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11Unreleased Changes
22------------------
33
4+ * Feature - Support disabling queue url region detection through ` disable_queue_url_region_detection ` .
5+
461.110.0 (2026-01-16)
57------------------
68
Original file line number Diff line number Diff line change @@ -213,6 +213,9 @@ class Client < Seahorse::Client::Base
213213 # @option options [Boolean] :disable_host_prefix_injection (false)
214214 # When `true`, the SDK will not prepend the modeled host prefix to the endpoint.
215215 #
216+ # @option options [Boolean] :disable_queue_url_region_detection (false)
217+ # When set to `true`, the region will not be extracted from a provided queue url. Defaults to `false`.
218+ #
216219 # @option options [Boolean] :disable_request_compression (false)
217220 # When set to 'true' the request body will not be compressed
218221 # for supported operations.
Original file line number Diff line number Diff line change @@ -5,6 +5,19 @@ module SQS
55 module Plugins
66 # @api private
77 class QueueUrls < Seahorse ::Client ::Plugin
8+ # When set to `true`, the signing region will not be modified if the configured
9+ # region does not match the region extracted from a provided queue url.
10+ #
11+ # When set to 'false', the signing region will be modified to use the region
12+ # extracted from a provided queue url if it differs from the configured region.
13+ option (
14+ :disable_queue_url_region_detection ,
15+ default : false ,
16+ doc_type : 'Boolean' ,
17+ docstring : <<~DOCS )
18+ When set to `true`, the region will not be extracted from a provided queue url. Defaults to `false`.
19+ DOCS
20+
821 # Extract region from a provided queue_url
922 class Handler < Seahorse ::Client ::Handler
1023 def call ( context )
@@ -22,6 +35,8 @@ def update_endpoint(context, url)
2235 # If the region in the queue url is not the configured
2336 # region, then we will modify signing to use it
2437 def update_region ( context , queue_url )
38+ return if context . config . disable_queue_url_region_detection
39+
2540 if ( queue_region = parse_region ( queue_url ) ) &&
2641 queue_region != context . config . region
2742 context [ :auth_scheme ] [ 'signingRegion' ] = queue_region
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ module Aws
2828 ?correct_clock_skew: bool ,
2929 ?defaults_mode: String,
3030 ?disable_host_prefix_injection: bool ,
31+ ?disable_queue_url_region_detection: bool ,
3132 ?disable_request_compression: bool ,
3233 ?endpoint: String,
3334 ?endpoint_cache_max_entries: Integer,
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ module Aws
2828 ?correct_clock_skew: bool ,
2929 ?defaults_mode: String,
3030 ?disable_host_prefix_injection: bool ,
31+ ?disable_queue_url_region_detection: bool ,
3132 ?disable_request_compression: bool ,
3233 ?endpoint: String,
3334 ?endpoint_cache_max_entries: Integer,
Original file line number Diff line number Diff line change @@ -81,6 +81,32 @@ module SQS
8181 expect ( resp . context . http_request . headers [ 'authorization' ] )
8282 . to include ( 'us-west-2' )
8383 end
84+
85+ it 'disables region detection when disable_queue_url_region_detection is true' do
86+ url = 'https://sqs.us-west-2.amazonaws.com/1234567890/demo'
87+ client = Client . new (
88+ stub_responses : true ,
89+ region : 'us-east-1' ,
90+ disable_queue_url_region_detection : true
91+ )
92+ resp = client . send ( method , params . merge ( queue_url : url ) )
93+ expect ( resp . context . http_request . headers [ 'authorization' ] )
94+ . to include ( 'us-east-1' )
95+ expect ( resp . context . http_request . headers [ 'authorization' ] )
96+ . not_to include ( 'us-west-2' )
97+ end
98+
99+ it 'uses configured region for custom endpoints when detection disabled' do
100+ url = 'https://sqs.elb-proxy.elb-gamma.us-east-1.amazonaws.com/1234567890/demo'
101+ client = Client . new (
102+ stub_responses : true ,
103+ region : 'us-east-1' ,
104+ disable_queue_url_region_detection : true
105+ )
106+ resp = client . send ( method , params . merge ( queue_url : url ) )
107+ expect ( resp . context . http_request . headers [ 'authorization' ] )
108+ . to include ( 'us-east-1' )
109+ end
84110 end
85111 end
86112 end
You can’t perform that action at this time.
0 commit comments