Add conditional check when cors.allowOrigin is *