Skip to content

Bug: RedfishEventListener_v1.py fails to handle HTTP/1.1 chunked encoding (HTTP 411 errors) #45

@joshua-scanlon

Description

@joshua-scanlon

The DMTF Redfish-Event-Listener (v1.1.7) fails to handle HTTP/1.1 chunked transfer encoding, returning HTTP 411 (LengthRequired) errors when receiving event POST requests that use Transfer-Encoding: chunked instead of Content-Length headers.

Environment:

• Listener Version: RedfishEventListener_v1.py v1.1.7
• Python Version: [Your Python version]
• HTTP Protocol: HTTP/1.1
• Firmware: IRC 1.1.0 (uses chunked encoding for event delivery)

Root Cause: The listener code at lines 108-115 strictly requires Content-Length headers and rejects requests without them:

Check for the content length

try:
length = int(self.headers["content-length"])
except:
my_logger.error("{} - No Content-Length header".format(self.client_address[0]))
self.send_response(411) # HTTP 411 Length Required
self.send_header("Content-Length", "0")
self.end_headers()
return

This violates HTTP/1.1 specification (RFC 7230) which states that servers must support both Content-Length and Transfer-Encoding: chunked methods.

Expected Behavior: The listener should accept both:

• Requests with Content-Length headers (legacy)
• Requests with Transfer-Encoding: chunked headers (HTTP/1.1 compliant)

Actual Behavior:

• Listener returns HTTP 411 errors for chunked encoding requests
• Event delivery fails 100% when chunked encoding is used
• No configuration option to enable chunked encoding support

Proposed Fix: Add support for Transfer-Encoding: chunked header detection and handling:

Check for transfer encoding first (HTTP/1.1 compliant)

if "transfer-encoding" in self.headers:
# Handle chunked encoding
# Read chunked data properly
pass
else:
# Handle Content-Length (legacy method)
try:
length = int(self.headers["content-length"])
except:
my_logger.error("{} - No Content-Length header".format(self.client_address[0]))
self.send_response(411)
self.send_header("Content-Length", "0")
self.end_headers()
return

Impact:

• Prevents event delivery from systems using HTTP/1.1 chunked encoding
• Blocks testing with modern firmware implementations
• Violates HTTP/1.1 specification requirements

References:

• HTTP/1.1 Specification: RFC 7230
• Test environment: IRC 1.1.0 firmware
• Related JIT: JIT-387341

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions