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

Commit 1745097

Browse files
authored
fix: remove invalid Accept: "odkcentral" header (triggers ModSec 920600) (#348)
1 parent ca7eec4 commit 1745097

2 files changed

Lines changed: 1 addition & 4 deletions

File tree

osm_fieldwork/OdkCentral.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,6 @@ def authenticate(
188188
self.user = user
189189
if not self.passwd:
190190
self.passwd = passwd
191-
# Enable persistent connection, create a cookie for this session
192-
self.session.headers.update({"accept": "odkcentral"})
193191

194192
# Get a session token
195193
try:
@@ -798,7 +796,7 @@ def getSubmissions(
798796
# log.debug(f'Getting submissions for {projectId}, Form {xform}')
799797
result = self.session.get(
800798
url,
801-
headers=dict({"Content-Type": "application/json", "accept": "odkcentral"}, **self.session.headers),
799+
headers=dict({"Content-Type": "application/json"}, **self.session.headers),
802800
verify=self.verify,
803801
)
804802
if result.status_code == 200:

osm_fieldwork/OdkCentralAsync.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ async def __aenter__(self):
8787
# Header enables persistent connection, creates a cookie for this session
8888
self.session = aiohttp.ClientSession(
8989
raise_for_status=True,
90-
headers={"accept": "odkcentral"},
9190
)
9291
await self.authenticate()
9392
return self

0 commit comments

Comments
 (0)