Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Commit

Permalink
Validate extension from url
Browse files Browse the repository at this point in the history
  • Loading branch information
aguilerapy committed Jul 2, 2020
1 parent a5363c0 commit 8d5c226
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion default/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,10 @@ def upload_url(request):
if 'input_url' in data:
url = request.POST.get(data)
basename = data
extension = ".json"
if request.POST.get('type') == 'csv xlsx zip':
extension = os.path.splitext(urlparse(url).path)[1]
else:
extension = ".json"
folder = 'media'
data_file = DataFile(basename, extension)

Expand Down

0 comments on commit 8d5c226

Please sign in to comment.