@@ -222,7 +222,11 @@ async def clear_org_previous_slugs_matching_slug(
222
222
)
223
223
224
224
async def add_crawls_to_collection (
225
- self , coll_id : UUID , crawl_ids : List [str ], org : Organization
225
+ self ,
226
+ coll_id : UUID ,
227
+ crawl_ids : List [str ],
228
+ org : Organization ,
229
+ headers : Optional [dict ] = None ,
226
230
) -> CollOut :
227
231
"""Add crawls to collection"""
228
232
await self .crawl_ops .add_to_collection (crawl_ids , coll_id , org )
@@ -245,10 +249,14 @@ async def add_crawls_to_collection(
245
249
)
246
250
)
247
251
248
- return await self .get_collection_out (coll_id , org )
252
+ return await self .get_collection_out (coll_id , org , headers )
249
253
250
254
async def remove_crawls_from_collection (
251
- self , coll_id : UUID , crawl_ids : List [str ], org : Organization
255
+ self ,
256
+ coll_id : UUID ,
257
+ crawl_ids : List [str ],
258
+ org : Organization ,
259
+ headers : Optional [dict ] = None ,
252
260
) -> CollOut :
253
261
"""Remove crawls from collection"""
254
262
await self .crawl_ops .remove_from_collection (crawl_ids , coll_id )
@@ -270,7 +278,7 @@ async def remove_crawls_from_collection(
270
278
)
271
279
)
272
280
273
- return await self .get_collection_out (coll_id , org )
281
+ return await self .get_collection_out (coll_id , org , headers )
274
282
275
283
async def get_collection_raw (
276
284
self , coll_id : UUID , oid : UUID , public_or_unlisted_only : bool = False
@@ -1067,9 +1075,11 @@ async def get_collection_search_values(
1067
1075
response_model = CollOut ,
1068
1076
)
1069
1077
async def get_collection (
1070
- coll_id : UUID , org : Organization = Depends (org_viewer_dep )
1078
+ coll_id : UUID , request : Request , org : Organization = Depends (org_viewer_dep )
1071
1079
):
1072
- return await colls .get_collection_out (coll_id , org )
1080
+ return await colls .get_collection_out (
1081
+ coll_id , org , headers = dict (request .headers )
1082
+ )
1073
1083
1074
1084
@app .get (
1075
1085
"/orgs/{oid}/collections/{coll_id}/replay.json" ,
@@ -1136,9 +1146,12 @@ async def update_collection(
1136
1146
async def add_crawl_to_collection (
1137
1147
crawlList : AddRemoveCrawlList ,
1138
1148
coll_id : UUID ,
1149
+ request : Request ,
1139
1150
org : Organization = Depends (org_crawl_dep ),
1140
1151
) -> CollOut :
1141
- return await colls .add_crawls_to_collection (coll_id , crawlList .crawlIds , org )
1152
+ return await colls .add_crawls_to_collection (
1153
+ coll_id , crawlList .crawlIds , org , headers = dict (request .headers )
1154
+ )
1142
1155
1143
1156
@app .post (
1144
1157
"/orgs/{oid}/collections/{coll_id}/remove" ,
@@ -1148,10 +1161,11 @@ async def add_crawl_to_collection(
1148
1161
async def remove_crawl_from_collection (
1149
1162
crawlList : AddRemoveCrawlList ,
1150
1163
coll_id : UUID ,
1164
+ request : Request ,
1151
1165
org : Organization = Depends (org_crawl_dep ),
1152
1166
) -> CollOut :
1153
1167
return await colls .remove_crawls_from_collection (
1154
- coll_id , crawlList .crawlIds , org
1168
+ coll_id , crawlList .crawlIds , org , headers = dict ( request . headers )
1155
1169
)
1156
1170
1157
1171
@app .delete (
0 commit comments