Assume that chain() gets two empty iterators. If it does this call to ziperator() will have no responders. If that's the case, there's some logic in this loop that assumes that the loop will be called at least once. If it's not called, the response will end up writing (I believe) "PKPK" (the second "PK" being the problem and a result of the incorrect logic) which is not a valid zip file.
A preferable behaviour would be to return a 404 response somewhere in __call__() with a helpful message about what parameters were received and about how there are no stations that meet the given criteria.
Issue #8 handled the potential for empty station lists being requested by the PCDS portal. However, I believe that the calling code can still fail.
Assume that" (the second "PK" being the problem and a result of the incorrect logic) which is not a valid zip file.
chain()
gets two empty iterators. If it does this call toziperator()
will have no responders. If that's the case, there's some logic in this loop that assumes that the loop will be called at least once. If it's not called, the response will end up writing (I believe) "PKPKA preferable behaviour would be to return a 404 response somewhere in
__call__()
with a helpful message about what parameters were received and about how there are no stations that meet the given criteria.