File tree Expand file tree Collapse file tree 3 files changed +9
-4
lines changed
Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 11[project ]
22name = " brainapi2"
3- version = " 1.6.1 -dev"
3+ version = " 1.6.2 -dev"
44description = " Version 1.x.x of the BrainAPI memory layer."
55authors = [
66 {name = " Christian" ,email = " alch.infoemail@gmail.com" }
Original file line number Diff line number Diff line change @@ -22,10 +22,15 @@ class BrainMiddleware(BaseHTTPMiddleware):
2222 async def dispatch (self , request : Request , call_next ):
2323 brain_id = None
2424
25- brain_id = request .query_params .get ("brain_id " )
25+ brain_id = request .headers .get ("X-Brain-ID " )
2626 if brain_id :
2727 brain_id = brain_id .rstrip ()
2828
29+ if brain_id is None :
30+ brain_id = request .query_params .get ("brain_id" )
31+ if brain_id :
32+ brain_id = brain_id .rstrip ()
33+
2934 if brain_id is None and request .method in ("POST" , "PUT" , "PATCH" ):
3035 body = await request .body ()
3136 if body :
Original file line number Diff line number Diff line change @@ -26,8 +26,8 @@ async def get_brains_list():
2626
2727
2828@system_router .post (path = "/brains" )
29- async def create_brain ():
29+ async def create_brain (brain_id : str ):
3030 """
3131 Create a new brain
3232 """
33- return await create_new_brain_controller ()
33+ return await create_new_brain_controller (brain_id )
You can’t perform that action at this time.
0 commit comments