Skip to content

Commit

Permalink
feat: add HTTP Referer to requests for Technicolor Routers (#6)
Browse files Browse the repository at this point in the history
* add HTTP Referrer for Technicolor CGA4322DE Firmware: 2.0.17-IMS-KDG

* increased version number

* add Technicolor CGA4322DE Firmware: 2.0.17-IMS-KDG as tested to README

* fix curly braces

* add Technicolor CGA4322DE Firmware: 3.0.41-IMS-KDG as tested to README
  • Loading branch information
macearl committed Jan 6, 2022
1 parent e1ffd6e commit 5c6564a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Access your Arris TG3442DE or Technicolor CGA4322DE, CGA6444VF (aka Vodafone Sta
Currently the following hardware/software is supported:

- Arris TG3442DE running `AR01.02.068.11_092320_711.PC20.10`, `01.02.068.13.EURO.PC20`
- Technicolor CGA4322DE running `1.0.9-IMS-KDG`
- Technicolor CGA4322DE running `1.0.9-IMS-KDG`, `2.0.17-IMS-KDG`, `3.0.41-IMS-KDG`
- Technicolor CGA6444VF running firmware `19.3B57-1.0.41`

<details>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vodafone-station-cli",
"description": "Access your Vodafone Station from the comfort of the command line.",
"version": "1.1.3",
"version": "1.1.4",
"author": "Dobroslav Totev",
"bin": {
"vodafone-station-cli": "./bin/run"
Expand Down
14 changes: 12 additions & 2 deletions src/modem/technicolor-modem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,9 @@ export class Technicolor extends Modem {
try {
const {data: salt} = await this.httpClient.post<TechnicolorSaltResponse>('/api/v1/session/login', `username=${Modem.USERNAME}&password=seeksalthash`, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'},
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'Referer': 'http://${this.modemIp}/',
}
})
this.logger.debug('Salt', salt)

Expand All @@ -163,12 +165,14 @@ export class Technicolor extends Modem {
const {data: loginResponse} = await this.httpClient.post<TechnicolorBaseResponse>('/api/v1/session/login', `username=${Modem.USERNAME}&password=${derivedKey}`, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'Referer': 'http://${this.modemIp}/',
},
})
this.logger.debug('Login status', loginResponse)
const {data: messageResponse} = await this.httpClient.get<TechnicolorBaseResponse>('/api/v1/session/menu', {
headers: {
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'Referer': 'http://${this.modemIp}/',
},
})
this.logger.debug('Message status', messageResponse)
Expand All @@ -178,7 +182,12 @@ export class Technicolor extends Modem {
}

async docsis(): Promise<DocsisStatus> {
const {data: docsisStatus} = await this.httpClient.get('/api/v1/sta_docsis_status')
const {data: docsisStatus} = await this.httpClient.get('/api/v1/sta_docsis_status', {
headers: {
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'Referer': 'http://${this.modemIp}/',
},
})
return normalizeDocsisStatus(docsisStatus as TechnicolorDocsisStatus)
}

Expand All @@ -195,6 +204,7 @@ export class Technicolor extends Modem {
headers: {
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'X-CSRF-TOKEN': tokenResponse.token,
'Referer': 'http://${this.modemIp}/',
},
})

Expand Down

0 comments on commit 5c6564a

Please sign in to comment.