We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3ed558b commit dc32b04Copy full SHA for dc32b04
proxypool/processors/server.py
@@ -1,3 +1,4 @@
1
+import hmac
2
from flask import Flask, g, request
3
from proxypool.exceptions import PoolEmptyException
4
from proxypool.storages.redis import RedisClient
@@ -22,7 +23,7 @@ def decorator(*args, **kwargs):
22
23
else:
24
return {"message": "Please provide an API key in header"}, 400
25
# Check if API key is correct and valid
- if request.method == "GET" and api_key == API_KEY:
26
+ if request.method == "GET" and hmac.compare_digest(api_key, API_KEY):
27
return func(*args, **kwargs)
28
29
return {"message": "The provided API key is not valid"}, 403
0 commit comments