Zoroastrianism and slavery

Zoroastrianism is considered one of the religions that legalized slavery, where poor slaves were brought in from wars.