IIS: fix dead Host header fallback (r->hostname == NULL can never be true) - #3622
IIS: fix dead Host header fallback (r->hostname == NULL can never be true)#3622A13501350 wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|




Summary
Fixes the
Hostheader fallback being dead code in the IIS module.r->hostnameis set fromConvertUTF16ToUTF8(req->CookedUrl.pHost, ...)(line 840). That helper never returnsNULL— on NULL/empty input, zero converted bytes, or conversion failure it returns the literal""(mymodule.cpp:180-184,:199-202,:226-229); on success it returns a pool-allocated buffer. Sor->hostnameis always non-NULL, andif(r->hostname == NULL)at line 843 was never true, silently skipping theHostheader fallback.Now the check also triggers on an empty string, so when the request URI carries no host (ordinary HTTP/1.1
GET /path+Host:header) the host is taken from theHostheader as intended.Fixes
Closes #3621
Changed location
iis/mymodule.cpp:843—if(r->hostname == NULL)→if(r->hostname == NULL || r->hostname[0] == '\0')The helper's contract is intentionally left unchanged so the other callers (
path_info,args) are unaffected.