All: Fix invalid module error handling in API (#46)

pull/47/head
Marc 2021-07-09 13:47:40 +01:00 committed by GitHub
parent e013581a14
commit 9f00b8fe15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 34 additions and 13 deletions

View File

@ -36,8 +36,11 @@ export class ApiService {
this.http.post('/api/module/request', payload).subscribe((r: any) => {
if (r === undefined || r === null) {
resp = this.emptyResponse;
} else if (r.error) {
resp = r;
} else {
resp = r.payload;
}
resp = r.payload;
}, (err) => {
resp = err.error;
if (err.status === 401) {

View File

@ -36,8 +36,11 @@ export class ApiService {
this.http.post('/api/module/request', payload).subscribe((r: any) => {
if (r === undefined || r === null) {
resp = this.emptyResponse;
} else if (r.error) {
resp = r;
} else {
resp = r.payload;
}
resp = r.payload;
}, (err) => {
resp = err.error;
if (err.status === 401) {

View File

@ -3,6 +3,6 @@
"title": "Cabinet",
"author": "newbi3",
"description": "A simple browser based file manager for the WiFi Pineapple.",
"version": "1.1",
"version": "1.2",
"firmware_required": "1.0.0"
}

View File

@ -36,8 +36,11 @@ export class ApiService {
this.http.post('/api/module/request', payload).subscribe((r: any) => {
if (r === undefined || r === null) {
resp = this.emptyResponse;
} else if (r.error) {
resp = r;
} else {
resp = r.payload;
}
resp = r.payload;
}, (err) => {
resp = err.error;
if (err.status === 401) {

View File

@ -3,6 +3,6 @@
"title": "Evil Portal",
"description": "An evil captive portal for the WiFi Pineapple.",
"author": "newbi3",
"version": "1.3",
"version": "1.4",
"firmware_required": "1.0.0"
}

View File

@ -36,8 +36,11 @@ export class ApiService {
this.http.post('/api/module/request', payload).subscribe((r: any) => {
if (r === undefined || r === null) {
resp = this.emptyResponse;
} else if (r.error) {
resp = r;
} else {
resp = r.payload;
}
resp = r.payload;
}, (err) => {
resp = err.error;
if (err.status === 401) {

View File

@ -2,7 +2,7 @@
"name": "httpeek",
"title": "HTTPeek",
"description": "View plaintext HTTP traffic, such as cookies and images.",
"version": "1.1",
"author": "newbi3",
"version": "1.2",
"firmware_required": "1.0.0"
}

View File

@ -36,8 +36,11 @@ export class ApiService {
this.http.post('/api/module/request', payload).subscribe((r: any) => {
if (r === undefined || r === null) {
resp = this.emptyResponse;
} else if (r.error) {
resp = r;
} else {
resp = r.payload;
}
resp = r.payload;
}, (err) => {
resp = err.error;
if (err.status === 401) {

View File

@ -2,7 +2,7 @@
"name": "mdk4",
"title": "MDK4",
"description": "Web GUI for the MDK4 wireless testing tool.",
"version": "1.2",
"author": "newbi3",
"version": "1.3",
"firmware_required": "1.0.0"
}

View File

@ -36,8 +36,11 @@ export class ApiService {
this.http.post('/api/module/request', payload).subscribe((r: any) => {
if (r === undefined || r === null) {
resp = this.emptyResponse;
} else if (r.error) {
resp = r;
} else {
resp = r.payload;
}
resp = r.payload;
}, (err) => {
resp = err.error;
if (err.status === 401) {

View File

@ -2,7 +2,7 @@
"name": "nmap",
"title": "Nmap",
"description": "Web GUI for Nmap, the popular network mapping tool.",
"version": "1.2",
"author": "newbi3",
"version": "1.3",
"firmware_required": "1.0.0"
}

View File

@ -36,8 +36,11 @@ export class ApiService {
this.http.post('/api/module/request', payload).subscribe((r: any) => {
if (r === undefined || r === null) {
resp = this.emptyResponse;
} else if (r.error) {
resp = r;
} else {
resp = r.payload;
}
resp = r.payload;
}, (err) => {
resp = err.error;
if (err.status === 401) {

View File

@ -2,7 +2,7 @@
"name": "tcpdump",
"title": "TCPDump",
"description": "Web GUI for the tcpdump packet analyzer tool.",
"version": "1.2",
"author": "newbi3",
"version": "1.3",
"firmware_required": "1.0.0"
}