  Cosmic transients, such as gamma-ray bursts and fast radio bursts, have been
used to constrain the Einstein's Equivalence Principle (EEP) through the
parametrized-post-Newtonian (PPN) formalism. In this approach, the time delay
of photons with different energies from these cosmic transients are used to
obtain upper bounds on the difference of the PPN $\gamma$ parameter. In this
work we assume that an important contribution to the time delay is due to the
dark matter halo of the Milky Way and consider the dark matter mass
distribution given by the Navarro--Frenk--White profile. We obtain the upper
limit on the difference of the PPN parameter $\gamma$ for the polarized
gamma-ray emission of GRB 110721A, $\Delta \gamma < 1.06 \times 10^{-28}$, the
most stringent limit to date on the EEP. In addition, we show that a very
similar upper bound is obtained if, instead of having a dark matter component,
a visible matter density profile and a non-minimal gravitational coupling
between curvature and matter are present.
