Encode command
This commit is contained in:
parent
3957a13129
commit
abecf095f2
|
@ -5,9 +5,17 @@ export class PaFirewall {
|
||||||
|
|
||||||
async login(username: string, ip: string, domain: string) {
|
async login(username: string, ip: string, domain: string) {
|
||||||
const command = this.createLoginCommand(username, ip, domain)
|
const command = this.createLoginCommand(username, ip, domain)
|
||||||
const url = `https://${this.ip}/api/?type=user-id&key=${this.key}&cmd=${command}`
|
const url = `https://${this.ip}/api/?type=user-id&key=${this.key}`
|
||||||
|
|
||||||
const response = await fetch(url, { method: 'POST' })
|
const formData = encodeURIComponent(command)
|
||||||
|
|
||||||
|
const response = await fetch(url, {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
|
||||||
|
},
|
||||||
|
body: `cmd=${formData}`
|
||||||
|
})
|
||||||
|
|
||||||
const data = await response.text()
|
const data = await response.text()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user