Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Commit ae0bc0f

Browse files
fix
1 parent 4e79f59 commit ae0bc0f

File tree

4 files changed

+89
-115
lines changed

4 files changed

+89
-115
lines changed

CargoHub/CARGOHUB/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
ALLOWED_HOSTS = ['145.24.223.64', 'localhost', '127.0.0.1']
2929

3030
# settings.py
31-
API_KEY_ADMIN = "a1b2c3d4e5"
31+
APIKEYADMIN = "a1b2c3d4e5"
3232

3333

3434

CargoHub/Cargohub_db.sqlite

0 Bytes
Binary file not shown.

CargoHub/api_app/views.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,17 @@ def get_api_key(self, request):
3838
"""
3939
Retrieve the API key from request headers.
4040
"""
41-
return request.headers.get("API_KEY_ADMIN")
41+
return request.headers.get("APIKEYADMIN")
42+
4243

4344
def validate_api_key(self, request):
4445
"""
4546
Validate the API key.
4647
"""
4748
api_key = self.get_api_key(request)
48-
if api_key != settings.API_KEY_ADMIN:
49+
print(f"Extracted API Key: {api_key}")
50+
print(f"Expected API Key: {settings.APIKEYADMIN}")
51+
if api_key != settings.APIKEYADMIN:
4952
return False
5053
return True
5154

0 commit comments

Comments
 (0)