Skip to content

Commit

Permalink
Merge branch 'dev' of gozargah:Gozargah/Marzban into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
SaintShit committed Oct 11, 2024
2 parents e60e54f + dcc9fd9 commit 49accab
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions app/models/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,14 +186,15 @@ def validate_fragment(cls, v):

@validator("noise_setting", check_fields=False)
def validate_noise(cls, v):
if v and not NOISE_PATTERN.match(v):
raise ValueError(
"Noise setting must be like this: packet,delay (rand:10-20,100-200)."
)
if len(v) > 2000:
raise ValueError(
"Noise can't be longer that 2000 character"
)
if v:
if not NOISE_PATTERN.match(v):
raise ValueError(
"Noise setting must be like this: packet,delay (rand:10-20,100-200)."
)
if len(v) > 2000:
raise ValueError(
"Noise can't be longer that 2000 character"
)
return v


Expand Down

0 comments on commit 49accab

Please sign in to comment.