@@ -54,39 +54,6 @@ describe("bucketEndpointMiddleware", () => {
54
54
expect ( path ) . toBe ( "/bucket" ) ;
55
55
} ) ;
56
56
57
- it ( "should not convert the request provided into one directed to a virtual hosted-style endpoint if so directed on the input" , async ( ) => {
58
- const request = new HttpRequest ( requestInput ) ;
59
- const handler = bucketEndpointMiddleware ( resolveBucketEndpointConfig ( { } ) ) (
60
- next ,
61
- { } as any
62
- ) ;
63
- await handler ( { input : { ...input , $forcePathStyle : true } , request } ) ;
64
-
65
- const {
66
- request : { hostname, path }
67
- } = next . mock . calls [ 0 ] [ 0 ] ;
68
-
69
- expect ( hostname ) . toBe ( "s3.us-west-2.amazonaws.com" ) ;
70
- expect ( path ) . toBe ( "/bucket" ) ;
71
- } ) ;
72
-
73
- it ( "should convert the request provided into one directed to a virtual hosted-style endpoint if path-style is disabled on the input" , async ( ) => {
74
- const request = new HttpRequest ( requestInput ) ;
75
- const handler = bucketEndpointMiddleware (
76
- resolveBucketEndpointConfig ( {
77
- forcePathStyle : true
78
- } )
79
- ) ( next , { } as any ) ;
80
- await handler ( { input : { ...input , $forcePathStyle : false } , request } ) ;
81
-
82
- const {
83
- request : { hostname, path }
84
- } = next . mock . calls [ 0 ] [ 0 ] ;
85
-
86
- expect ( hostname ) . toBe ( "bucket.s3.us-west-2.amazonaws.com" ) ;
87
- expect ( path ) . toBe ( "/" ) ;
88
- } ) ;
89
-
90
57
it ( "should not convert the request provided into one without the bucket in the path if so configured" , async ( ) => {
91
58
const request = new HttpRequest ( requestInput ) ;
92
59
const handler = bucketEndpointMiddleware (
@@ -111,12 +78,13 @@ describe("bucketEndpointMiddleware", () => {
111
78
112
79
it ( "should use the bucket name as a virtual hosted-style endpoint if so configured" , async ( ) => {
113
80
const request = new HttpRequest ( requestInput ) ;
114
- const handler = bucketEndpointMiddleware ( resolveBucketEndpointConfig ( { } ) ) (
115
- next ,
116
- { } as any
117
- ) ;
81
+ const handler = bucketEndpointMiddleware (
82
+ resolveBucketEndpointConfig ( {
83
+ bucketEndpoint : true
84
+ } )
85
+ ) ( next , { } as any ) ;
118
86
await handler ( {
119
- input : { Bucket : "files.domain.com" , $bucketEndpoint : true } ,
87
+ input : { Bucket : "files.domain.com" } ,
120
88
request : { ...request , path : "/files.domain.com/path/to/key.ext" }
121
89
} ) ;
122
90
@@ -147,45 +115,6 @@ describe("bucketEndpointMiddleware", () => {
147
115
expect ( path ) . toBe ( "/" ) ;
148
116
} ) ;
149
117
150
- it ( "should use a transfer acceleration endpoint if so directed on the input" , async ( ) => {
151
- const request = new HttpRequest ( requestInput ) ;
152
- const handler = bucketEndpointMiddleware ( resolveBucketEndpointConfig ( { } ) ) (
153
- next ,
154
- { } as any
155
- ) ;
156
- await handler ( {
157
- input : { ...input , $useAccelerateEndpoint : true } ,
158
- request
159
- } ) ;
160
-
161
- const {
162
- request : { hostname, path }
163
- } = next . mock . calls [ 0 ] [ 0 ] ;
164
-
165
- expect ( hostname ) . toBe ( "bucket.s3-accelerate.amazonaws.com" ) ;
166
- expect ( path ) . toBe ( "/" ) ;
167
- } ) ;
168
-
169
- it ( "should not use a transfer acceleration endpoint if disabled on the input" , async ( ) => {
170
- const request = new HttpRequest ( requestInput ) ;
171
- const handler = bucketEndpointMiddleware (
172
- resolveBucketEndpointConfig ( {
173
- useAccelerateEndpoint : true
174
- } )
175
- ) ( next , { } as any ) ;
176
- await handler ( {
177
- input : { ...input , $useAccelerateEndpoint : false } ,
178
- request
179
- } ) ;
180
-
181
- const {
182
- request : { hostname, path }
183
- } = next . mock . calls [ 0 ] [ 0 ] ;
184
-
185
- expect ( hostname ) . toBe ( "bucket.s3.us-west-2.amazonaws.com" ) ;
186
- expect ( path ) . toBe ( "/" ) ;
187
- } ) ;
188
-
189
118
it ( "should use a dualstack endpoint if so configured" , async ( ) => {
190
119
const request = new HttpRequest ( requestInput ) ;
191
120
const handler = bucketEndpointMiddleware (
@@ -205,45 +134,6 @@ describe("bucketEndpointMiddleware", () => {
205
134
expect ( path ) . toBe ( "/" ) ;
206
135
} ) ;
207
136
208
- it ( "should use a dualstack endpoint if so directed on the input" , async ( ) => {
209
- const request = new HttpRequest ( requestInput ) ;
210
- const handler = bucketEndpointMiddleware ( resolveBucketEndpointConfig ( { } ) ) (
211
- next ,
212
- { } as any
213
- ) ;
214
- await handler ( {
215
- input : { ...input , $useDualstackEndpoint : true } ,
216
- request
217
- } ) ;
218
-
219
- const {
220
- request : { hostname, path }
221
- } = next . mock . calls [ 0 ] [ 0 ] ;
222
-
223
- expect ( hostname ) . toBe ( "bucket.s3.dualstack.us-west-2.amazonaws.com" ) ;
224
- expect ( path ) . toBe ( "/" ) ;
225
- } ) ;
226
-
227
- it ( "should not use a dualstack endpoint if disabled on the input" , async ( ) => {
228
- const request = new HttpRequest ( requestInput ) ;
229
- const handler = bucketEndpointMiddleware (
230
- resolveBucketEndpointConfig ( {
231
- useDualstackEndpoint : true
232
- } )
233
- ) ( next , { } as any ) ;
234
- await handler ( {
235
- input : { ...input , $useDualstackEndpoint : false } ,
236
- request
237
- } ) ;
238
-
239
- const {
240
- request : { hostname, path }
241
- } = next . mock . calls [ 0 ] [ 0 ] ;
242
-
243
- expect ( hostname ) . toBe ( "bucket.s3.us-west-2.amazonaws.com" ) ;
244
- expect ( path ) . toBe ( "/" ) ;
245
- } ) ;
246
-
247
137
it ( "should use an accelerate dualstack endpoint if configured" , async ( ) => {
248
138
const request = new HttpRequest ( requestInput ) ;
249
139
const handler = bucketEndpointMiddleware (
0 commit comments