The nearside dipped headlight on my 2004 TF packed up. An inspection revealed that it wasn't the bulb but the bulb connector and wiring inside the lamp. I sourced a pair of H7 connectors from eBay and set about repairing it.
I removed the cover from the back of the lamp
You can see the scorched yellow wire. The insulation on the blue wire has disintegrated
The connector has melted too
I cut the wires about 3cm from the connector as the insulation seemed OK here
Here is the new connector, tinned and ready to go, complete with heat-shrink tubing
All soldered and insulated.
Ideally, I would have liked to have replaced the whole length of wire (the leads on the new connectors were long enough) but I couldn't figure out how to. The offside dipped headlight not quite so bad but will be repaired the same way. The main beam lights are perfect, presumably because they don't get used as much, as talkingcars suggested.