Interface nsINetUtilType

nsINetUtil provides various network-related utility methods.

Hierarchy

Methods

  • Increases the reference count for this interface. The associated instance will not be deleted unless the reference count is returned to zero.

    Returns

    The resulting reference count.

    Returns number

  • Parameters

    • aIID: object
    • Optional aInstancePtr: object

    Returns any

  • A run time mechanism for interface discovery.

    Returns

    NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.

    aInstancePtr must not be null.

    Parameters

    • aIID: object

      [in] A requested interface IID

    • aInstancePtr: object

      [out] A pointer to an interface pointer to receive the result.

    Returns void

  • Decreases the reference count for this interface. Generally, if the reference count returns to zero, the associated instance is deleted.

    Returns

    The resulting reference count.

    Returns number

  • Test whether the protocol handler for this URI or that for any of its inner URIs has the given protocol flags. This will QI aURI to nsINestedURI and walk the nested URI chain.

    Returns

    whether any of the protocol handlers involved have all the flags in aFlags.

    Parameters

    • aURI: nsIURI

      the URI in question

    • aFlags: number

      the flags we're testing for.

    Returns boolean

  • escape a string with %00-style escaping

    Parameters

    • aString: string
    • aEscapeType: number

    Returns string

  • %XX-Escape invalid chars in a URL segment.

    Returns

    the escaped string (the string itself if escaping did not happen)

    Parameters

    • aStr: string

      the URL to be escaped

    • aFlags: number

      the URL segment type flags

    Returns string

  • Extract the charset parameter location and value from a content-type header.

    Returns

    whether a charset parameter was found. This can be false even in cases when parseContentType would claim to have a charset, if the type that won out does not have a charset parameter specified.

    Parameters

    • aTypeHeader: string

      the header string to parse

    • aCharset: string
    • aCharsetStart: number
    • aCharsetEnd: number

    Returns boolean

  • This is a void method that is C++ implemented and always returns NS_ERROR_NOT_IMPLEMENTED. To be used for testing.

    Returns void

  • Parse a Content-Type header value in strict mode. This is a more conservative parser that reject things that violate RFC 7231 section 3.1.1.1. This is typically useful for parsing Content-Type header values that are used for HTTP requests, and those that are used to make security decisions.

    Returns

    the MIME type specified in the header, in lower-case.

    Parameters

    • aTypeHeader: string

      the header string to parse

    • aCharset: string
    • aHadCharset: boolean

    Returns string

  • Parse a Content-Type header value in relaxed mode. This is a more permissive parser that ignores things that go against RFC 7231 section 3.1.1.1. This is typically useful for parsing Content-Type header values received from web servers where we want to make a best effort attempt at extracting a useful MIME type and charset.

    NOTE: DO NOT USE THIS if you're going to make security decisions based on the result.

    Returns

    the MIME type specified in the header, in lower-case.

    Parameters

    • aTypeHeader: string

      the header string to parse

    • aCharset: string
    • aHadCharset: boolean

    Returns string

  • Test whether the given URI's handler has the given protocol flags.

    Returns

    whether the protocol handler for aURI has all the flags in aFlags.

    Parameters

    • aURI: nsIURI

      the URI in question

    • aFlag: number

    Returns boolean

  • This is test-only. Send an IPC message to let socket process send a telemetry.

    Returns void

  • Expands URL escape sequences

    Returns

    unescaped string

    Parameters

    • aStr: string

      the URL to be unescaped

    • aFlags: number

      only ESCAPE_URL_ONLY_NONASCII and ESCAPE_URL_SKIP_CONTROL are recognized. If |aFlags| is 0 all escape sequences are unescaped

    Returns string

Generated using TypeDoc