Contents

reportFormat

The format the manager uses to send blocked URL reports.

Declaration

var reportFormat: NEURLFilterManager.ReportFormat { get set }

Discussion

Use the values in the NEURLFilterManager.ReportFormat enumeration to specify the format to use. By default, the manager uses the NEURLFilterManager.ReportFormat.json format.

Handling JSON results

When you specify the NEURLFilterManager.ReportFormat.json format, your endpoint receives data in JSON as a simple array of strings. The structure of this data is like the following:

[
	"example.com",
	"example2.com",
	"example3.com"
]

Handling Protobuf results

When you specify the NEURLFilterManager.ReportFormat.protobuf format, your endpoint receives the Protocol Buffers wire format with manual encoding for a repeated string field. Each URL entry follows this binary structure:

Field Tag

1 byte (0x0A = field number 1, wire type 2 for length-delimited).

String Length

A variable-length integer (varint) encoding the byte length of the URL string.

String Data

UTF-8 encoded URL bytes.

For strings under 128 bytes, the length is a single byte. For longer strings, the protocol uses varint encoding, where each byte has the MSB set (0x80) except the final byte.

The following example shows the encoding of the URL https://example.com:

Example encoding for URL "https://example.com":
[0x0A]    [0x13]    [h][t][t][p][s][:][/][/][e][x][a][m][p][l][e][.][c][o][m]
^tag      ^len=19   ^------------ 19 bytes of UTF-8 string data ------------^

See Also

Producing filtering reports