You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixes the Host header fallback being dead code in the IIS module.
r->hostname is set from ConvertUTF16ToUTF8(req->CookedUrl.pHost, ...) (line 840). That helper never returns NULL — 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. So r->hostname is always non-NULL, and if(r->hostname == NULL) at line 843 was never true, silently skipping the Host header 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 the Host header as intended.
Auto reviews are disabled on base/target branches other than the default branch.
Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 159d3c3a-9f22-4d8b-8d8d-ffc7208c44de
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
🔍 Trigger review
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.