Closed readevalprint closed 10 years ago
Hello,
Thank you for the patch - and for making me realise that I'd left some debugging code in there to print any errors I was testing for :D
The exception you're seeing suggests that the proxy was unable to parse your HTTP request since successful validation would always result in the 'upgrade' attribute being set. I'd neglected to actually return the response created after a parse error is detected so that would explain how this was happening: our latest patch should fix the behaviour.
Could you please let us know if this not the case?
@david-farrar I see the changes in #24 and will give them a try now. Also I don't think this PR merged correctly. Did you still want to merge it or was that a mistake?
'' and None are semantically different so your patch needed a little tweaking. I believe it is normal and was due to the way the patches were merged.
And thank you for your help
@thomas-mangin sure I understand the need for tweaks but what I mean is this PR #23 was just merged when it doesn't make sense to anymore. You can see in the current master branch (02c273ab00aee71908f2fa8e2698960c70751d7e) that response_string
is assigned redundantly, decision
is never returned, and source == 'proxy'
is compared twice. And glad to help! Thanks for writing exaproxy.
Whoops.
I'd accidentally left my own change to that bit of code in the previous patch and had to manually fix the conflicts caused in your pull request. Apparently I should just have got some sleep instead :)
Haha no worries, always opt for sleep. Thanks for fixing this.
One more.... :D Now this one changes the behavior a bit (for the better I hope).
For some context on what is happening, I'm getting intermittent exceptions of
UnboundLocalError: local variable 'decision' referenced before assignment
and looking over it, the only way this can happen is ifdecideICAP
raises an exception that was then caught and printed then tries to returndecision
. And so I wondered what the original exception was. A bit of judicial debugging showse
isAttributeError("'HTTP' object has no attribute 'upgrade'",)
.So seeing how an exception in decideHTTP will still raise an exception, it makes sense to let the original one bubble up.