A large request header can cause failures in IIRF when proxying requests.
There's a hard-coded limit in IIRF on the size of a request header - 4k for each header. When the header on a request to be proxied is larger than 4k, IIRF passes a dummy string that is not a valid header. Which gives a ERROR_INVALID_PARAMETER (errno 87) error in WinHttpAddRequestHeaders.
There are really two problems in IIRF:
- When the request exceeds the size of IIRF's hardcoded limit, IIRF just silently passes through that error, and instead of formatting the large header correctly, it formats a dummy string. IIRF should fail fast and emit a clear error message into the log.
- There's no way to modify the hardcoded limit in IIRF.
This workitem should fix both issues.
This will introduce a new directive for use within IIRF.ini files: MaxFieldLength . This name is borrowed from the IIS Registry entry described in http://support.microsoft.com/kb/820129 . Optimally, IIRF would read the registry and set the value intelligently. But I think I may defer that particular capability until it is specifically requested.