max-request backport from 0.8