HTTP API Toolkit HTTP API Toolkit
HTTP API Toolkit HTTP API Toolkit
DocFX + Singulink = ♥

Search Results for

    Property SavedRangesFile

    SavedRangesFile

    Gets or sets the file that Cloudflare's IP ranges are saved to after each download, and read from at startup when they cannot be downloaded. It is required, has no default, and is null while it is not set.

    Declaration
    [MaybeNull]
    public required IAbsoluteFilePath SavedRangesFile { get; set; }
    Property Value
    Type Description
    IAbsoluteFilePath
    Remarks

    The application fails to start if it is still not set then. When DownloadRanges is false, the ranges are only read from this file. If the file cannot be written, downloaded ranges are still used.

    The file can be created in advance, for example for a new server, a container image or a read-only deployment. It contains one IP range per line in CIDR notation, like the lists that Cloudflare publishes, and must end with a line that contains only # end, which shows that the file is complete. Blank lines and other lines that start with # are ignored. A file without the end line is not used, so a file that is read while it is still being written is never partly trusted.

    The file must be a path with friendly names, one that is valid for NoUnfriendlyNames, on every platform. A path bound from a configuration is read with None, so a typo such as a trailing space or dot would otherwise create a file or directory with that name, which many tools handle badly.

    The reflection-based configuration binder binds it from a string through the type converter of Singulink.IO.FileSystem, which reads it as a path of the platform the app runs on, with None, and the file then must have friendly names. The configuration binding source generator doesn't use type converters and leaves it unset, so an app that uses it sets the file in code, from a path that it parses, such as with ParseAbsolute(ReadOnlySpan<char>, PathOptions).

    Exceptions
    Type Condition
    ArgumentException

    The value is not a path with friendly names. The message names the path and its problem.

    © Singulink. All rights reserved.