228228 # changes and reset the minor version to zero. Otherwise, increment only
229229 # the minor version for backwards compatible changes. A backwards
230230 # compatible change is one that does not require updates to clients.
231- 'version' : '7.2 '
231+ 'version' : '7.3 '
232232 },
233233 'tags' : [
234234 {
@@ -1273,14 +1273,15 @@ def get_summary():
12731273 authentication = request .authentication )
12741274
12751275
1276- def manifest_route (* , fetch : bool , initiate : bool ):
1276+ def manifest_route (* , fetch : bool , method : str ):
1277+ initiate = method in {'PUT' , 'POST' }
12771278 return app .route (
12781279 # The path parameter could be a token *or* an object key, but we don't
12791280 # want to complicate the API with this detail
12801281 ('/fetch' if fetch else '' )
12811282 + ('/manifest/files' if initiate else '/manifest/files/{token}' ),
12821283 # The initial PUT request is idempotent.
1283- methods = ['PUT' if initiate else 'GET' ],
1284+ methods = [method ],
12841285 content_types = ['application/json' , 'application/x-www-form-urlencoded' ],
12851286 interactive = fetch ,
12861287 cors = True ,
@@ -1301,17 +1302,17 @@ def manifest_route(*, fetch: bool, initiate: bool):
13011302 ) + (
13021303 ' via XHR' if fetch else ''
13031304 ),
1304- 'description' : fd ('''
1305+ 'description' : fd (f '''
13051306 Create a manifest preparation job, returning either
13061307
13071308 - a 301 redirect to the URL of the status of that job or
13081309
13091310 - a 302 redirect to the URL of an already prepared manifest.
13101311
13111312 This endpoint is not suitable for interactive use via the
1312- Swagger UI. Please use [PUT /fetch/manifest/files][1] instead.
1313+ Swagger UI. Please use [{ method } /fetch/manifest/files][1] instead.
13131314
1314- [1]: #operations-Manifests-put_fetch_manifest_files
1315+ [1]: #operations-Manifests-{ method . lower () } _fetch_manifest_files
13151316 ''' ) + parameter_hoisting_note if initiate and not fetch else fd ('''
13161317 Check on the status of an ongoing manifest preparation job,
13171318 returning either
@@ -1326,15 +1327,15 @@ def manifest_route(*, fetch: bool, initiate: bool):
13261327 instead.
13271328
13281329 [1]: #operations-Manifests-get_fetch_manifest_files__token_
1329- ''' ) if not initiate and not fetch else fd ('''
1330+ ''' ) if not initiate and not fetch else fd (f '''
13301331 Create a manifest preparation job, returning a 200 status
13311332 response whose JSON body emulates the HTTP headers that would be
1332- found in a response to an equivalent request to the [PUT
1333+ found in a response to an equivalent request to the [{ method }
13331334 /manifest/files][1] endpoint.
13341335
13351336 Whenever client-side JavaScript code is used in a web
13361337 application to request the preparation of a manifest from Azul,
1337- this endpoint should be used instead of [PUT
1338+ this endpoint should be used instead of [{ method }
13381339 /manifest/files][1]. This way, the client can use XHR to make
13391340 the request, retaining full control over the handling of
13401341 redirects and enabling the client to bypass certain limitations
@@ -1344,7 +1345,7 @@ def manifest_route(*, fetch: bool, initiate: bool):
13441345 upper limit on the number of consecutive redirects, before the
13451346 manifest generation job is done.
13461347
1347- [1]: #operations-Manifests-put_manifest_files
1348+ [1]: #operations-Manifests-{ method . lower () } _manifest_files
13481349 ''' ) + parameter_hoisting_note if initiate and fetch else fd ('''
13491350 Check on the status of an ongoing manifest preparation job,
13501351 returning a 200 status response whose JSON body emulates the
@@ -1485,10 +1486,10 @@ def manifest_route(*, fetch: bool, initiate: bool):
14851486
14861487 For a detailed description of these properties see the
14871488 documentation for the respective response headers
1488- documented under ''' ) + (fd ('''
1489- [PUT /manifest/files][1].
1489+ documented under ''' ) + (fd (f '''
1490+ [{ method } /manifest/files][1].
14901491
1491- [1]: #operations-Manifests-put_manifest_files
1492+ [1]: #operations-Manifests-{ method . lower () } _manifest_files
14921493 ''' ) if initiate else fd ('''
14931494 [GET /manifest/files/{token}][1].
14941495
@@ -1530,28 +1531,32 @@ def manifest_route(*, fetch: bool, initiate: bool):
15301531 )
15311532
15321533
1533- @manifest_route (fetch = False , initiate = True )
1534+ @manifest_route (fetch = False , method = 'PUT' )
1535+ @manifest_route (fetch = False , method = 'POST' )
15341536def file_manifest ():
15351537 return _file_manifest (fetch = False )
15361538
15371539
1538- @manifest_route (fetch = False , initiate = False )
1540+ @manifest_route (fetch = False , method = 'GET' )
15391541def file_manifest_with_token (token : str ):
15401542 return _file_manifest (fetch = False , token_or_key = token )
15411543
15421544
1543- @manifest_route (fetch = True , initiate = True )
1545+ @manifest_route (fetch = True , method = 'PUT' )
1546+ @manifest_route (fetch = True , method = 'POST' )
15441547def fetch_file_manifest ():
15451548 return _file_manifest (fetch = True )
15461549
15471550
1548- @manifest_route (fetch = True , initiate = False )
1551+ @manifest_route (fetch = True , method = 'GET' )
15491552def fetch_file_manifest_with_token (token : str ):
15501553 return _file_manifest (fetch = True , token_or_key = token )
15511554
15521555
15531556def _file_manifest (fetch : bool , token_or_key : Optional [str ] = None ):
15541557 request = app .current_request
1558+ require (request .method != 'POST' or request .raw_body == b'' ,
1559+ 'The body must be empty for a POST request to this endpoint.' )
15551560 query_params = request .query_params or {}
15561561 _hoist_parameters (query_params , request )
15571562 if token_or_key is None :
0 commit comments