Here, we summarise the conditions that might lead to the formation of a bow shock surrounding a planet's magnetosphere. Such shocks are formed as a result of the interaction of a planet with its host star wind. In the case of close-in planets, the shock develops ahead of the planetary orbit. If this shocked material is able to absorb stellar radiation, the shock signature can be revealed in (asymmetric) transit light curves. We propose that this is the case of the gas giant planet WASP-12b, whose near-UV transit observations have detected the presence of an extended material ahead of the planetary orbit. We show that shock detection through transit observations can be a useful tool to constrain planetary magnetic fields.