So I have some more insight on this. It seems to only happen during
sends when the authentication box pops up. So for example, the first
send since the app is started. I assume this box pops up because the
credentials have yet to be saved in the http session.
Anyway, I looked at the requests and responses when the box stays up
and when it goes away properly. Here's what I'm seeing. (Keep in mind
this is a custom aggregator so the problem could be in the way I'm
handling the requests.)
BAD
···
-----------Started HEAD "/submission" for 10.1.0.202 at 2011-07-25 12:04:51 -0400
Completed 401 Unauthorized in 1ms
Started POST "/submission" for 10.1.0.202 at 2011-07-25 12:04:52 -0400
Completed 401 Unauthorized in 60ms
Started HEAD "/submission" for 10.1.0.202 at 2011-07-25 12:04:57 -0400
Completed 401 Unauthorized in 1ms
Started HEAD "/submission" for 10.1.0.202 at 2011-07-25 12:04:57 -0400
Completed 204 No Content in 170ms (Views: 36.0ms | ActiveRecord: 2.4ms)
Started POST "/submission" for 10.1.0.202 at 2011-07-25 12:04:57 -0400
Completed 401 Unauthorized in 16ms
Started POST "/submission" for 10.1.0.202 at 2011-07-25 12:04:58 -0400
Completed 201 Created in 969ms (Views: 1.1ms | ActiveRecord: 39.6ms)
GOOD
Started HEAD "/submission" for 10.1.0.202 at 2011-07-25 12:05:47 -0400
Completed 401 Unauthorized in 1ms
Started HEAD "/submission" for 10.1.0.202 at 2011-07-25 12:05:47 -0400
Completed 204 No Content in 153ms (Views: 2.1ms | ActiveRecord: 3.4ms)
Started POST "/submission" for 10.1.0.202 at 2011-07-25 12:05:48 -0400
Completed 401 Unauthorized in 4ms
Started POST "/submission" for 10.1.0.202 at 2011-07-25 12:05:48 -0400
Completed 201 Created in 591ms (Views: 1.2ms | ActiveRecord: 58.8ms)
So it seems there are two extra requests, one HEAD and one POST that
are made at the beginning of the bad chain. I have no idea why. Any
ideas? Am I returning the right things here? It seems like a bit of a
bummer that the app is making two post requests even when it works,
but maybe this is how Basic authentication works? I'm not sure...