MCPcopy Create free account
hub / github.com/axe-api/axe-api / constructor

Method constructor

packages/axe-api/src/Services/AxeRequest.ts:15–37  ·  view source on GitHub ↗
(request: IncomingMessage)

Source from the content-addressed store, hash-verified

13 private version: IVersion | undefined;
14
15 constructor(request: IncomingMessage) {
16 this.request = request;
17 this.request.tags = [];
18 this.urlObject = new URL(request.url || "", "http://127.0.0.1");
19
20 // Application configuration is need for the default setting.
21 this.version = getVersionByRequest(this.urlObject);
22
23 if (this.version) {
24 // Setting the current language by the supported, default and the client prefences
25 this.language = AcceptLanguageResolver.resolve(
26 (this.request.headers["accept-language"] as string) || "",
27 this.version.config.supportedLanguages || ["en"],
28 this.version.config.defaultLanguage || "en",
29 );
30 } else {
31 this.language = {
32 title: "en",
33 language: "en",
34 region: null,
35 };
36 }
37 }
38
39 /**
40 * Get the URL Object

Callers

nothing calls this directly

Calls 2

getVersionByRequestFunction · 0.90
resolveMethod · 0.45

Tested by

no test coverage detected