Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

Commit

Permalink
Implement a content length check (#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
kuylar authored Jan 12, 2024
1 parent 791385b commit d6aae53
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
2 changes: 2 additions & 0 deletions LightTube/Controllers/SettingsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ public IActionResult ImportExport()
try
{
IFormFile file = Request.Form.Files[0];
if (file.Length is 0 or > 10 * 1024 * 1024)
return View(new ImportContext(HttpContext, "Imported file cannot be larger than 10 megabytes.", true));
using Stream fileStream = file.OpenReadStream();
using MemoryStream memStr = new();
fileStream.CopyTo(memStr);
Expand Down
20 changes: 10 additions & 10 deletions LightTube/Views/Settings/ImportExport.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
File
</div>
<div>
See below for supported formats
(up to 10MB) See below for supported formats
</div>
</div>
<div class="settings-option__option">
Expand All @@ -33,15 +33,15 @@
<h1 class="title">Export Data</h1>
<a href="/export/fullData.json" class="btn-blue btn-outline">Export all data as JSON</a>

<h1 class="title">Supported formats for importing</h1>
<ul>
<li>YouTube takeouts (.zip)</li>
<li>Invidious XML/OPML exports (.xml)</li>
<li>Invidious JSON exports (.json)</li>
<li>Piped playlists (.json)</li>
<li>Piped subscriptions (.json)</li>
<li>LightTube exports (.json)</li>
</ul>
<p>
<h1 class="title">Supported formats for importing</h1>
<ul>
<li>YouTube takeouts (.zip)</li>
<li>Invidious XML/OPML exports (.xml)</li>
<li>Invidious JSON exports (.json)</li>
<li>Piped playlists (.json)</li>
<li>Piped subscriptions (.json)</li>
<li>LightTube exports (.json)</li>
</ul>
If you need support for other websites/apps, please <a href="https://github.com/kuylar/LightTube/issues">open an issue on GitHub</a>
</p>

0 comments on commit d6aae53

Please sign in to comment.