Commit 97862a0
authored
fix(submission): fix anonymous submission failures from
### 📣 Summary
Ensure `KoboCollect` can submit anonymously by returning 204 for `HEAD
/<username>/submission` before applying the [empty-request
authentication
check](https://github.com/kobotoolbox/kpi/blob/b4b82b809c205dfb0a23eba7633e57f50ac35c6f/kobo/apps/openrosa/apps/api/viewsets/xform_submission_api.py#L253-L257),
while keeping Digest authentication behavior intact.
### 📖 Description
After adding a guard to return `401` for unauthenticated empty-body POST
requests (required for Digest auth handshake), KoboCollect began failing
anonymous submissions. KoboCollect performs an initial HEAD request to
`/<username>/submission` to probe server availability. Because the guard
ran before the HEAD handler, this probe was incorrectly treated as
unauthenticated, returning 401. KoboCollect interprets a 401 on HEAD as
"credentials required" and therefore never sends the actual XML payload,
showing the login screen instead.
Enketo continued to work because it tolerates a 401 on the first probe,
but KoboCollect does not.KoboCollect DEV-1347 (#6499)1 parent 7fd2421 commit 97862a0
File tree
2 files changed
+39
-6
lines changed- kobo/apps/openrosa/apps/api
- tests/viewsets
- viewsets
2 files changed
+39
-6
lines changedLines changed: 33 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
955 | 955 | | |
956 | 956 | | |
957 | 957 | | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
958 | 991 | | |
959 | 992 | | |
960 | 993 | | |
| |||
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | 253 | | |
260 | 254 | | |
261 | 255 | | |
262 | 256 | | |
263 | 257 | | |
264 | 258 | | |
265 | 259 | | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
266 | 266 | | |
267 | 267 | | |
268 | 268 | | |
| |||
0 commit comments