Improve ignore-assets middleware fn