(request: IncomingMessage)
| 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 |
nothing calls this directly
no test coverage detected