|
@@ -140,6 +140,23 @@ def clip():
|
|
|
if len(content) > CLIP_SIZE_LIMIT:
|
|
|
return abort(418, f"Paste can not exceed {CLIP_SIZE_LIMIT}")
|
|
|
|
|
|
+ if request.params.copy == 'true':
|
|
|
+ response.content_type = 'text/html; charset=utf-8'
|
|
|
+ form = template(
|
|
|
+ 'clip-form',
|
|
|
+ action='/clip',
|
|
|
+ method='post',
|
|
|
+ content=content,
|
|
|
+ disabled=False
|
|
|
+ )
|
|
|
+ return template(
|
|
|
+ 'paste',
|
|
|
+ form=form,
|
|
|
+ link=f'{LOCATION}/clip',
|
|
|
+ disabled=False,
|
|
|
+ download=None
|
|
|
+ )
|
|
|
+
|
|
|
_bytes = blake(content, person='clip'.encode('utf-8'))
|
|
|
_b32 = bytes_to_base32(_bytes)
|
|
|
directory = f'app/rest/static/{_b32}'
|
|
@@ -153,7 +170,6 @@ def clip():
|
|
|
|
|
|
form = template('clip-form', action='/clip', method='post', content=content)
|
|
|
response.content_type = 'text/html; charset=utf-8'
|
|
|
-
|
|
|
return redirect(f'/clip?hash={_b32}')
|
|
|
|
|
|
def validate(filename: str) -> bytes:
|