Closed GoogleCodeExporter closed 9 years ago
w.r.t. #2: Since we are using digest authentication, the server must initiate
the interaction by specifying the realm and a server nonce, after which the
client can formulate a cnonce and an appropriate authenticated reply. The HEAD
requests, while they do incur a network round-trip, have minimal size and are
used to negotiate the channel security (http/https) and authentication (if any)
prior to sending the much larger POST. When you are submitting multiple forms,
Collect is sending the HEAD request only once for a particular server, so the
bandwidth/latency costs are negligible.
W.r.t. return code -- a HEAD request CAN return a different response code from
a GET - the HTTP spec requires that the header information be identical, but
the response status line (and status code) is not a header. In this case,
since the two OpenRosa return codes are 201 (created) and 202 (accepted), and
the appropriate choice is entirely based upon the POST-body missing from the
HEAD request, it would be inappropriate for the server to return either value.
201 means the server fully processed the submission. 202 means it is being held
but is in limbo. (
https://bitbucket.org/javarosa/javarosa/wiki/FormSubmissionAPI ). Hence the
appropriate return of 204 (no content).
Original comment by mitchellsundt@gmail.com
on 21 Sep 2011 at 5:28
Just an update on #1 here.. it turns out this actually prevents you from seeing
more than one form when using the old format, as because the formId is always
null, every form past the first overwrites the previous in the map. The key in
the map is the formId, so it is stuff 'null' as the key over and over.
That really should be a critical bug for any release of the new version.
Original comment by nicpott...@gmail.com
on 6 Oct 2011 at 10:13
Oh and on the return code, I don't much care, but I do think you are misusing
HEAD here.. By contract HEAD is already idempotent, ie, it is already known
that it will not actually DO anything, but rather is a 'ping' to see if it
tried to do something whether it would work.
http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html
I think it is definitely more in the spirit of the spec to have it return the
exact same status code as actual submission. Changing the status code is a
really odd use case in combination with HEAD.
Original comment by nicpott...@gmail.com
on 6 Oct 2011 at 10:19
Original comment by yanokwa
on 25 May 2012 at 3:46
Original comment by yanokwa
on 25 May 2012 at 8:14
Fixed the missing formId issue in 1.2 codebase, where it is informational. The
map was changed in 1.1.7 to resolve this bug differently.
Confirmed that in 1.2 (and 1.1.7, as this code hasn't changed) that the
transmission is:
HEAD (fail - server supplies NONCE)
[user confirms username and password]
HEAD (fail - server supplies NONCE)
HEAD (success - using NONCE)
POST (success)
i.e., no extra POST.
Original comment by mitchellsundt@gmail.com
on 30 Jun 2012 at 1:01
Original issue reported on code.google.com by
yanokwa
on 17 Sep 2011 at 8:28