[http] Fix a bug in pack-dir.