Skip to content

Implement a minimal OnBeginRequest handler - #8

Merged
sassi67 merged 1 commit into
mainfrom
minimal-onbeginrequest
Aug 20, 2026
Merged

sassi67 merged 1 commit into
mainfrom
minimal-onbeginrequest

Conversation

@sassi67

@sassi67 sassi67 commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Replace the all-methods CHttpModule skeleton with the real request-level module the walkthrough calls for:

  • iis::IISRequestLevelModule (iis_request_level_module.h/.cpp) overrides only OnBeginRequest plus the mandatory Dispose(). Requests whose cooked URL path ends with "/forbidden" (case-insensitive, query string excluded) get a 403 with reason "Forbidden by IISRequestLevelModule", skipping custom errors so the reason phrase survives; every other response gets the X-IISRequestLevelModule: 1 header.
  • iis::HttpModuleFactory becomes iis::IISRequestLevelModuleFactory, named after the module it creates.
  • RegisterModule now subscribes to RQ_BEGIN_REQUEST.

Closes #7

Replace the all-methods CHttpModule skeleton with the real request-level
module the walkthrough calls for:

- iis::IISRequestLevelModule (iis_request_level_module.h/.cpp) overrides
  only OnBeginRequest plus the mandatory Dispose(). Requests whose cooked
  URL path ends with "/forbidden" (case-insensitive, query string
  excluded) get a 403 with reason "Forbidden by IISRequestLevelModule",
  skipping custom errors so the reason phrase survives; every other
  response gets the X-IISRequestLevelModule: 1 header.
- iis::HttpModuleFactory becomes iis::IISRequestLevelModuleFactory, named
  after the module it creates.
- RegisterModule now subscribes to RQ_BEGIN_REQUEST.

Closes #7

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@sassi67 sassi67 self-assigned this Aug 20, 2026
@sassi67
sassi67 merged commit 63ff6d2 into main Aug 20, 2026
2 checks passed
@sassi67
sassi67 deleted the minimal-onbeginrequest branch August 21, 2026 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A minimal OnBeginRequest implementation

1 participant