Rate limit middleware ported