I don't have a strong opinion that it's good or bad practice, I just thought it was a clever thing to do about it.
Edit: I think I was thinking of https://news.ycombinator.com/item?id=17636032 / https://www.idontplaydarts.com/2016/04/detecting-curl-pipe-b.... Wow, it's been a while.