fix "can't set headers" exception

see discussion in #113
Merge branch '0.9.x' of github.com:rlidwka/sinopia