Share via


3.2.5.2.3 Common Message Validation

See section 2.2.1 for more details about the common standard HTTP headers and HTTP headers specific to the BITS Upload Protocol. The response sent from the server in the discussion that follows MUST be based on the type of message received from the client (except PING messages). See sections 2.2.3, 2.2.7, 2.2.9, and 2.2.11 for the message format of various responses sent from the server.

The server MUST verify that the request message satisfies the requirements in section 2.2. If the request message fails to satisfy the requirements, the server MUST send a 400 HTTP status code with BITS-Error 0x80070057, BITS-Error-Context 0x5.

The server MUST check whether the client has sufficient access permissions to upload the request entity to the location provided through the destination URL. If not, the server MUST send a 403 HTTP status code with BITS-Error 0x80070005, BITS-Error-Context 0x5.

The request MUST contain a Content-Length header. If not, the server MUST reject the message and SHOULD return a 411 HTTP status code with BITS-Error 0x80070057, BITS-Error-Context 0x5.<23>

Except for the CREATE-SESSION message, the server MUST validate that the BITS session ID sent from the client is one of the active BITS sessions on the server. If no corresponding active BITS session exists on the server, the server MUST return a 500 HTTP status code with BITS-Error x8020001F, BITS-Error-Context 0x5.

After the initial validation has succeeded, the server uses the BITS-Packet-Type header to determine the message type and processes the message as appropriate. Specific actions for each message type are described in the following sections.