Working as a contractor means you're self-employed and the relations you have with "your boss" are a B2B relationship where you agree to get something done in exchange for money - no different from renting office space or servers. Since you're a business owner, you're expected to be competent in the areas of business (which can be cut-throat) and law. You chose to take on this risk by being a contractor.