@@ -37,7 +37,7 @@ class UpdatePlayerPoints(BaseModel):
3737
3838# ck_playerrank
3939@router .post (
40- "surftimer/insertPlayerRank" ,
40+ "/ surftimer/insertPlayerRank" ,
4141 name = "Add Player Rank" ,
4242 tags = ["ck_playerrank" ],
4343)
@@ -70,7 +70,9 @@ async def insertPlayerRank(
7070 content_data = {"inserted" : xquery , "xtime" : time .perf_counter () - tic }
7171 if xquery < 1 :
7272 response .body = json .dumps (content_data ).encode ('utf-8' )
73+ response .headers ['content-type' ] = 'application/json'
7374 response .status_code = status .HTTP_304_NOT_MODIFIED
75+ response .headers ['content-type' ] = 'application/json'
7476 return response
7577
7678 # Prepare the response
@@ -79,10 +81,11 @@ async def insertPlayerRank(
7981
8082 response .body = json .dumps (content_data ).encode ('utf-8' )
8183 response .status_code = status .HTTP_201_CREATED
84+ response .headers ['content-type' ] = 'application/json'
8285 return response
8386
8487@router .put (
85- "surftimer/updatePlayerRankPoints" ,
88+ "/ surftimer/updatePlayerRankPoints" ,
8689 name = "Update Player Rank Points 1" ,
8790 tags = ["ck_playerrank" ],
8891)
@@ -119,6 +122,7 @@ async def updatePlayerRankPoints(
119122 content_data = {"updated" : xquery , "xtime" : time .perf_counter () - tic }
120123 if xquery < 1 :
121124 response .body = json .dumps (content_data ).encode ('utf-8' )
125+ response .headers ['content-type' ] = 'application/json'
122126 response .status_code = status .HTTP_304_NOT_MODIFIED
123127 return response
124128
@@ -127,11 +131,12 @@ async def updatePlayerRankPoints(
127131 print (f"Execution time { toc - tic :0.4f} " )
128132
129133 response .body = json .dumps (content_data ).encode ('utf-8' )
134+ response .headers ['content-type' ] = 'application/json'
130135 response .status_code = status .HTTP_200_OK
131136 return response
132137
133138@router .put (
134- "surftimer/updatePlayerRankPoints2" ,
139+ "/ surftimer/updatePlayerRankPoints2" ,
135140 name = "Update Player Rank Points 2" ,
136141 tags = ["ck_playerrank" ],
137142)
@@ -171,6 +176,7 @@ async def updatePlayerRankPoints2(
171176 content_data = {"updated" : xquery , "xtime" : time .perf_counter () - tic }
172177 if xquery < 1 :
173178 response .body = json .dumps (content_data ).encode ('utf-8' )
179+ response .headers ['content-type' ] = 'application/json'
174180 response .status_code = status .HTTP_304_NOT_MODIFIED
175181 return response
176182
@@ -179,11 +185,12 @@ async def updatePlayerRankPoints2(
179185 print (f"Execution time { toc - tic :0.4f} " )
180186
181187 response .body = json .dumps (content_data ).encode ('utf-8' )
188+ response .headers ['content-type' ] = 'application/json'
182189 response .status_code = status .HTTP_200_OK
183190 return response
184191
185192@router .put (
186- "surftimer/updatePlayerRank" ,
193+ "/ surftimer/updatePlayerRank" ,
187194 name = "Update Player Rank" ,
188195 tags = ["ck_playerrank" ],
189196)
@@ -208,6 +215,7 @@ async def updatePlayerRank(
208215 content_data = {"updated" : xquery , "xtime" : time .perf_counter () - tic }
209216 if xquery < 1 :
210217 response .body = json .dumps (content_data ).encode ('utf-8' )
218+ response .headers ['content-type' ] = 'application/json'
211219 response .status_code = status .HTTP_304_NOT_MODIFIED
212220 return response
213221
@@ -216,6 +224,7 @@ async def updatePlayerRank(
216224 print (f"Execution time { toc - tic :0.4f} " )
217225
218226 response .body = json .dumps (content_data ).encode ('utf-8' )
227+ response .headers ['content-type' ] = 'application/json'
219228 response .status_code = status .HTTP_200_OK
220229 return response
221230
@@ -261,7 +270,7 @@ async def selectPlayerName(
261270
262271
263272@router .put (
264- "surftimer/updateLastSeenMySQL" ,
273+ "/ surftimer/updateLastSeenMySQL" ,
265274 name = "Update Last Seen" ,
266275 tags = ["ck_playerrank" ],
267276)
@@ -278,6 +287,7 @@ async def updateLastSeen(
278287 content_data = {"updated" : xquery , "xtime" : time .perf_counter () - tic }
279288 if xquery < 1 :
280289 response .body = json .dumps (content_data ).encode ('utf-8' )
290+ response .headers ['content-type' ] = 'application/json'
281291 response .status_code = status .HTTP_304_NOT_MODIFIED
282292 return response
283293
@@ -286,6 +296,7 @@ async def updateLastSeen(
286296 print (f"Execution time { toc - tic :0.4f} " )
287297
288298 response .body = json .dumps (content_data ).encode ('utf-8' )
299+ response .headers ['content-type' ] = 'application/json'
289300 response .status_code = status .HTTP_200_OK
290301 return response
291302
0 commit comments