Harry is constantly giving hints that he's queer. He always picks up LGBT flags and waves them around or compliments men in the audience in a flirty way. His song cinema is about "Pop", a sex drug used almost exclusively by gay men (mainly in the past). He even begged to play the role of a gay man in my policeman and the director said he only casts actual gay people and that Harry is like the character. Why would he be so obsessed with a book that's about a secret gay romance and relate to it if he was straight?
Louis most definitely isn't straight either. There's a video of him saying "too bad I'm gay, Eleanor" to his ex and most of his songs are about trying to be brave, having secrets and other stuff, so it makes sense if he's gay.