mirror of https://github.com/jumpserver/jumpserver
fix: 修复下载rdp文件失败的问题
parent
ec393c1440
commit
4563743f00
|
@ -1,5 +1,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
|
import urllib.parse
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.core.cache import cache
|
from django.core.cache import cache
|
||||||
from django.shortcuts import get_object_or_404
|
from django.shortcuts import get_object_or_404
|
||||||
|
@ -148,7 +150,8 @@ class UserConnectionTokenViewSet(RootOrgViewMixin, SerializerMixin2, GenericView
|
||||||
data += f'{k}:{v}\n'
|
data += f'{k}:{v}\n'
|
||||||
response = HttpResponse(data, content_type='text/plain')
|
response = HttpResponse(data, content_type='text/plain')
|
||||||
filename = "{}-{}-jumpserver.rdp".format(user.username, asset.hostname)
|
filename = "{}-{}-jumpserver.rdp".format(user.username, asset.hostname)
|
||||||
response['Content-Disposition'] = 'attachment; filename={}'.format(filename)
|
filename = urllib.parse.quote(filename)
|
||||||
|
response['Content-Disposition'] = 'attachment; filename*=UTF-8\'\'%s' % filename
|
||||||
return response
|
return response
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|
Loading…
Reference in New Issue