When you say shorted out, you mean the high beams went off?
If so, that sounds like the high beam circuit is pulling too much current, and you are tripping the circuit breaker. When this happens, if you leave the brights switched on, do they eventually come back on again (even if just for a moment)?
If this is the case it is the circuit between the dimmer switch and the headlamps that is at fault.
Regardless, here is the way to rule out your headlight switch as the culprit before you go out and start throwing parts at it. Get a alligator clip jumper with decent-sized wire. Disconnect the switch and jumper the 'batt' and the 'headlight' terminals at the headlight switch connector. Now put on the brights and wait. If they go off, you know that it is not your headlight switch that is at fault.
Remember that the headlight switch does not really send power to the headlights. It sends power to the dimmer switch. The dimmer switch decides whether to send the power to either the low beam or the high beam circuit. Therefore, if your headlights switch is working for the low beams, it works for the high beams since all it really sees is current going thru it on the way to the dimmer switch. If your low beams are working, that kind of indicates that your headlight switch might be fine. When you get the high beams going, the circuit draws more current and the breaker is opening.
There are only two things that can cause this to happen. One is if the high beam circuit wires - which are downstream of the dimmer switch - are drawing way too much current, for example due to a frayed wire touching ground. The other is if your headlight switch has an internal problem, and for whatever reason can handle the quantity of low beam current, but pukes at the higher, high-beam current.
Obviously it is easier to replace a plug-in switch than to chase a short through the wiring harness. So since you know your connections at the switch are good, the next step is to jumper the switch as I described above. If the problem goes away you are confident that you are not wasting $20 on a switch. If the problem persists, save the 20 and start checking your harness.
Let us know if it comes to that as I can give you a few tips on checking that harness.