HttpRouteCorsPolicy.fromJson constructor

HttpRouteCorsPolicy.fromJson(
  1. Map json_
)

Implementation

HttpRouteCorsPolicy.fromJson(core.Map json_)
    : this(
        allowCredentials: json_.containsKey('allowCredentials')
            ? json_['allowCredentials'] as core.bool
            : null,
        allowHeaders: json_.containsKey('allowHeaders')
            ? (json_['allowHeaders'] as core.List)
                .map((value) => value as core.String)
                .toList()
            : null,
        allowMethods: json_.containsKey('allowMethods')
            ? (json_['allowMethods'] as core.List)
                .map((value) => value as core.String)
                .toList()
            : null,
        allowOriginRegexes: json_.containsKey('allowOriginRegexes')
            ? (json_['allowOriginRegexes'] as core.List)
                .map((value) => value as core.String)
                .toList()
            : null,
        allowOrigins: json_.containsKey('allowOrigins')
            ? (json_['allowOrigins'] as core.List)
                .map((value) => value as core.String)
                .toList()
            : null,
        disabled: json_.containsKey('disabled')
            ? json_['disabled'] as core.bool
            : null,
        exposeHeaders: json_.containsKey('exposeHeaders')
            ? (json_['exposeHeaders'] as core.List)
                .map((value) => value as core.String)
                .toList()
            : null,
        maxAge: json_.containsKey('maxAge')
            ? json_['maxAge'] as core.String
            : null,
      );