Stream Alerts: Enforce sensible length limits on Name and Message (#285)

Co-authored-by: Fitti <fitti@fitti.io>
This commit is contained in:
Fitti 2021-08-04 16:32:51 +02:00 committed by GitHub
parent baf3b76c33
commit 0813adb70d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -89,8 +89,8 @@ async def post_donation(donation_id: str) -> tuple:
if service.servicename == "Streamlabs":
url = "https://streamlabs.com/api/v1.0/donations"
data = {
"name": donation.name,
"message": donation.message,
"name": donation.name[:25],
"message": donation.message[:255],
"identifier": "LNbits",
"amount": donation.amount,
"currency": donation.cur_code.upper(),

View File

@ -10,6 +10,7 @@
filled
dense
v-model.trim="donationDialog.data.name"
maxlength="25"
type="name"
label="Your Name (leave blank for Anonymous donation)"
></q-input>
@ -19,6 +20,7 @@
v-model.number="donationDialog.data.sats"
type="number"
min="1"
max="2100000000000000"
suffix="sats"
:rules="[val => val > 0 || 'Choose a positive number of sats!']"
label="Amount of sats"
@ -27,6 +29,7 @@
filled
dense
v-model.trim="donationDialog.data.message"
maxlength="255"
type="textarea"
label="Donation Message (you can leave this blank too)"
></q-input>