public final class CorsOptions extends Object
| Constructor and Description |
|---|
CorsOptions(List<String> allowedOrigins)
Constructor of
CorsOptions. |
| Modifier and Type | Method and Description |
|---|---|
List<String> |
getAllowedOrigins()
Get the allowedOrigins property: The list of origins from which
JavaScript code will be granted access to your index.
|
Long |
getMaxAgeInSeconds()
Get the maxAgeInSeconds property: The duration for which browsers should
cache CORS preflight responses.
|
CorsOptions |
setMaxAgeInSeconds(Long maxAgeInSeconds)
Set the maxAgeInSeconds property: The duration for which browsers should
cache CORS preflight responses.
|
public CorsOptions(List<String> allowedOrigins)
CorsOptions.allowedOrigins - The list of origins from which JavaScript code will be granted access to
your index. Can contain a list of hosts of the form
{protocol}://{fully-qualified-domain-name}[:{port#}], or a single '*' to
allow all origins (not recommended).public List<String> getAllowedOrigins()
public Long getMaxAgeInSeconds()
public CorsOptions setMaxAgeInSeconds(Long maxAgeInSeconds)
maxAgeInSeconds - the maxAgeInSeconds value to set.Copyright © 2020 Microsoft Corporation. All rights reserved.