Skip to content

Introduce IHttpRequestHead to decouple public API from Kayak#118

Merged
hibri merged 1 commit intomasterfrom
copilot/implement-first-step-in-plan
Mar 28, 2026
Merged

Introduce IHttpRequestHead to decouple public API from Kayak#118
hibri merged 1 commit intomasterfrom
copilot/implement-first-step-in-plan

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 28, 2026

Kayak.Http.HttpRequestHead was leaking into every public interface and internal method signature, coupling the entire HttpMock API to the Kayak library.

New types

  • IHttpRequestHeadHttpMock-owned interface exposing Method, Uri, Headers, and HasBody()
  • KayakHttpRequestHeadAdapter — thin adapter wrapping Kayak.Http.HttpRequestHead, constructed once at the Kayak boundary

Boundary isolation

RequestProcessor.OnRequest is the sole Kayak entry-point (required by IHttpRequestDelegate). The Kayak type is now wrapped immediately there; nothing downstream sees it:

public void OnRequest(HttpRequestHead request, IDataProducer body, IHttpResponseDelegate response)
{
    IHttpRequestHead requestHead = new KayakHttpRequestHeadAdapter(request);
    // all internal calls use requestHead (IHttpRequestHead)
}

Updated signatures

All public interfaces (IRequestHandler, IRequestVerify, IStubResponse, IMatchingRule, IRequestMatcher) and their implementations now reference IHttpRequestHead instead of Kayak.Http.HttpRequestHead. Unit tests updated accordingly.

…ecouple public API from Kayak

Agent-Logs-Url: https://github.com/hibri/HttpMock/sessions/8ebe72a3-8ec0-44f9-b23c-a985b16bf7da

Co-authored-by: hibri <122442+hibri@users.noreply.github.com>
@hibri hibri marked this pull request as ready for review March 28, 2026 13:41
@hibri hibri merged commit 7796284 into master Mar 28, 2026
1 check passed
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.

2 participants