Interface Cors.Builder

    • Method Detail

      • allowCredentials

        Cors.Builder allowCredentials​(Boolean allowCredentials)

        Whether to allow cookies or other credentials in requests to your function URL. The default is false.

        Parameters:
        allowCredentials - Whether to allow cookies or other credentials in requests to your function URL. The default is false.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • allowHeaders

        Cors.Builder allowHeaders​(Collection<String> allowHeaders)

        The HTTP headers that origins can include in requests to your function URL. For example: Date, Keep-Alive, X-Custom-Header.

        Parameters:
        allowHeaders - The HTTP headers that origins can include in requests to your function URL. For example: Date, Keep-Alive, X-Custom-Header.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • allowHeaders

        Cors.Builder allowHeaders​(String... allowHeaders)

        The HTTP headers that origins can include in requests to your function URL. For example: Date, Keep-Alive, X-Custom-Header.

        Parameters:
        allowHeaders - The HTTP headers that origins can include in requests to your function URL. For example: Date, Keep-Alive, X-Custom-Header.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • allowMethods

        Cors.Builder allowMethods​(Collection<String> allowMethods)

        The HTTP methods that are allowed when calling your function URL. For example: GET, POST, DELETE, or the wildcard character (*).

        Parameters:
        allowMethods - The HTTP methods that are allowed when calling your function URL. For example: GET, POST, DELETE, or the wildcard character (*).
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • allowMethods

        Cors.Builder allowMethods​(String... allowMethods)

        The HTTP methods that are allowed when calling your function URL. For example: GET, POST, DELETE, or the wildcard character (*).

        Parameters:
        allowMethods - The HTTP methods that are allowed when calling your function URL. For example: GET, POST, DELETE, or the wildcard character (*).
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • allowOrigins

        Cors.Builder allowOrigins​(Collection<String> allowOrigins)

        The origins that can access your function URL. You can list any number of specific origins, separated by a comma. For example: https://www.example.com, http://localhost:60905.

        Alternatively, you can grant access to all origins using the wildcard character (*).

        Parameters:
        allowOrigins - The origins that can access your function URL. You can list any number of specific origins, separated by a comma. For example: https://www.example.com, http://localhost:60905 .

        Alternatively, you can grant access to all origins using the wildcard character (*).

        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • allowOrigins

        Cors.Builder allowOrigins​(String... allowOrigins)

        The origins that can access your function URL. You can list any number of specific origins, separated by a comma. For example: https://www.example.com, http://localhost:60905.

        Alternatively, you can grant access to all origins using the wildcard character (*).

        Parameters:
        allowOrigins - The origins that can access your function URL. You can list any number of specific origins, separated by a comma. For example: https://www.example.com, http://localhost:60905 .

        Alternatively, you can grant access to all origins using the wildcard character (*).

        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • exposeHeaders

        Cors.Builder exposeHeaders​(Collection<String> exposeHeaders)

        The HTTP headers in your function response that you want to expose to origins that call your function URL. For example: Date, Keep-Alive, X-Custom-Header.

        Parameters:
        exposeHeaders - The HTTP headers in your function response that you want to expose to origins that call your function URL. For example: Date, Keep-Alive, X-Custom-Header.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • exposeHeaders

        Cors.Builder exposeHeaders​(String... exposeHeaders)

        The HTTP headers in your function response that you want to expose to origins that call your function URL. For example: Date, Keep-Alive, X-Custom-Header.

        Parameters:
        exposeHeaders - The HTTP headers in your function response that you want to expose to origins that call your function URL. For example: Date, Keep-Alive, X-Custom-Header.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • maxAge

        Cors.Builder maxAge​(Integer maxAge)

        The maximum amount of time, in seconds, that web browsers can cache results of a preflight request. By default, this is set to 0, which means that the browser doesn't cache results.

        Parameters:
        maxAge - The maximum amount of time, in seconds, that web browsers can cache results of a preflight request. By default, this is set to 0, which means that the browser doesn't cache results.
        Returns:
        Returns a reference to this object so that method calls can be chained together.