Skip to content

armgit / my-yt

Public Imported from GitHub
0

A clean and minimal youtube frontend, without all the ads and whistles

JavaScript

fix: adding channel without @

Christian Feic3bf59bb8be1
diff --git a/lib/server.js b/lib/server.js
index 0f3110d..3861b22 100644
--- a/lib/server.js
+++ b/lib/server.js
@@ -126,6 +126,7 @@ async function addChannelHandler(req, res, repo, connections = []) {
const body = await getBody(req)
let { name } = JSON.parse(body)
name = name.trim()
+ name = name.startsWith('@') ? name.substring(1) : name
if (repo.channelExists(name)) {
res.writeHead(409, { 'Content-Type': 'text/plain' })