mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-05 22:28:26 +02:00
Fix #328: Validate Date header in HTTP Signatures
This commit is contained in:
parent
2a7333df6f
commit
9017acdb39
4 changed files with 58 additions and 4 deletions
|
@ -5,6 +5,7 @@ import requests
|
|||
import requests_http_signature
|
||||
from django.conf import settings
|
||||
from django.utils import timezone
|
||||
from django.utils.http import http_date
|
||||
|
||||
from funkwhale_api.factories import registry
|
||||
|
||||
|
@ -39,7 +40,7 @@ class SignedRequestFactory(factory.Factory):
|
|||
default_headers = {
|
||||
"User-Agent": "Test",
|
||||
"Host": "test.host",
|
||||
"Date": "Right now",
|
||||
"Date": http_date(timezone.now().timestamp()),
|
||||
"Content-Type": "application/activity+json",
|
||||
}
|
||||
if extracted:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue