Flynntes / Sleeky

🎨 A sleek and simple frontend & backend theme for YOURLS
http://sleeky.flynntes.com
MIT License
472 stars 102 forks source link

Always HTTP Status Code 200 #125

Open spikehidden opened 1 year ago

spikehidden commented 1 year ago

When using Sleeky Backend all redirects send a 200 Status Code which causes site Scrapers to fail creating embeds (Discord, Twitter, ect.).

I also tried to check if it maybe an incompatibility with another Plugin so I deleted all of them and only left Sleeky being there. STill the same issue.

Sleeky: v.2.5.0 YOURLS: v.1.8.2

thompsonpaul commented 1 year ago

The problem is that Sleeky is using the fallback JavaScript method for ALL redirects instead of generating the needed 301-redirect headers. Thus each link registers as a 200 status. Seems to be a conflict with the base YOURLS itself, as I too encounter the issue even with no plugins installed.

thompsonpaul commented 1 year ago

I've discovered that fixing a user validation issue that was causing login errors also fixed this problem with Sleeky forcing YOURLS to use the fallback JavaScript redirect method that causes all shortlinks to generate a 200 server response instead of the needed 301-redirect.

Once corrected using @likeaross's solution https://github.com/Flynntes/Sleeky/issues/127#issuecomment-1586014710, YOURLS is again generating the proper 301-redirects even with Sleeky enabled.