Skip to content

Commit ca034a0

Browse files
committed
fix: improve API key purge command and remove redundant URL decoding
1 parent 92e9a89 commit ca034a0

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,7 @@ When you no longer need an API key, you can purge it from the server. This will:
150150
To purge your API key:
151151

152152
```bash
153-
# Replace 'your-api-key' with your actual API key
154-
curl -X DELETE -H "X-API-KEY: your-api-key" https://codequery.dev/api-keys/your-api-key
153+
source .env && curl -X DELETE -H "X-API-KEY: $API_KEY" https://codequery.dev/api-keys/your-api-key
155154
```
156155

157156
Note:

gateway/gateway.py

-3
Original file line numberDiff line numberDiff line change
@@ -436,9 +436,6 @@ async def purge_api_key(api_key: str, request: Request):
436436
Users can purge their own keys, while admin can purge any key.
437437
"""
438438
try:
439-
# URL decode the API key
440-
api_key = unquote_plus(api_key)
441-
442439
# Get the request API key
443440
request_api_key = request.headers.get("x-api-key")
444441
if not request_api_key:

0 commit comments

Comments
 (0)