Skip to content

Commit

Permalink
Fix :web for non-class HTTPServerRequest.
Browse files Browse the repository at this point in the history
  • Loading branch information
s-ludwig committed Feb 14, 2024
1 parent aeb0fcb commit 628af49
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions web/vibe/web/i18n.d
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ package string determineLanguage(alias METHOD)(scope HTTPServerRequest req)

unittest { // make sure that the custom determineLanguage is called
static struct CTX {
static string determineLanguage(Object a) { return "test"; }
static string determineLanguage(HTTPServerRequest a) { return "test"; }
}
@translationContext!CTX
static class Test {
Expand All @@ -350,7 +350,7 @@ unittest { // make sure that the custom determineLanguage is called
}
}
auto test = new Test;
assert(determineLanguage!(test.test)(null) == "test");
assert(determineLanguage!(test.test)(HTTPServerRequest.init) == "test");
}

unittest { // issue #1955
Expand Down
2 changes: 1 addition & 1 deletion web/vibe/web/web.d
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@ private struct RequestContext {

private RequestContext getRequestContext()
@trusted nothrow {
assert(s_requestContext.req !is null, "Request context used outside of a web interface request!");
assert(s_requestContext.req !is HTTPServerRequest.init, "Request context used outside of a web interface request!");
return s_requestContext;
}

Expand Down

0 comments on commit 628af49

Please sign in to comment.