MagLit icon indicating copy to clipboard operation
MagLit copied to clipboard

All magnet links currently fail

Open brian6932 opened this issue 4 months ago • 0 comments

Somewhat similar to #59, but not a Regex issue. Reproducible JS example:

await (await fetch('https://maglit.me/api/create', {
	__proto__: null,
	method: 'post',
	headers: {
		__proto__: null,
		'content-type': 'application/json'
	},
	body: `{"password":"","link":"magnet:?xt=urn:btih:737e24b5ab9e409cfc0ed80d93cba5b320396572","slug":"${Date.now().toString(36)}"}`
})).json()

All magnet links will result in the following response:

{"message":"Error checking the link."}

https://github.com/NayamAmarshe/MagLit/blob/e780c2010bd4d1e521b5e62b25c5c8b183b5a687/pages/api/create.js#L145 I believe e780c2010bd4d1e521b5e62b25c5c8b183b5a687 is at fault, and you're attempting to fetch() magnet links. https://github.com/NayamAmarshe/MagLit/blob/e780c2010bd4d1e521b5e62b25c5c8b183b5a687/pages/api/create.js#L129-L147

brian6932 avatar Oct 16 '24 22:10 brian6932