Fixed a defect in web api authorization check