Observational constraints on the structure of gamma-ray burst jets