I'm trying to find the two point correlation function for a massless scalar field obeying $\square \phi = 0$. I can write
$$\langle 0 | \phi(x) \phi(0)| 0 \rangle = \int \frac{d^dk}{(2\pi)^d} \delta(k^2)\theta(k_0)\langle 0| \phi(x) | k\rangle \langle k | \phi(0)|0\rangle= \int \frac{d^dk}{(2\pi)^d} e^{ikx}\delta(k^2)\theta(k_0)$$
where I've inserted the identity operator for 1-particle momentum eigenstates. But elsewhere I see the expression
$$\langle 0| \phi(x) \phi(0)|0 \rangle = \int \frac{d^dk}{(2\pi)^d} \frac{e^{ikx}}{k^2}$$
for instance, the first line of this page. Are these forms equivalent? Which is correct and why?