Skip to content

Commit

Permalink
feat: response password if password sent
Browse files Browse the repository at this point in the history
  • Loading branch information
shabane committed Mar 8, 2024
1 parent 4d69cb0 commit e5f40d9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions paste/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ def interpret(request):
if request.FILES.dict().get('file'):
file = request.FILES.get('file')
name = name_it(file)
return f"{request.get_host()}/file/{save(file, name, request.GET.get('password'))}"
password = request.GET.get('password')
return f"{request.get_host()}/file/{save(file, name, password)}/{password if password else ''}"
elif request.FILES.dict().get('once'):
file = request.FILES.get('once')
name = name_it(file)
return f"{request.get_host()}/file/{save(file, name, request.GET.get('password'), v_limit=1)}"
password = request.GET.get('password')
return f"{request.get_host()}/file/{save(file, name, password, v_limit=1)}/{password if password else ''}"
else:
#TODO: split username and other interprets
username = list(request.FILES.keys())[0]
Expand Down

0 comments on commit e5f40d9

Please sign in to comment.