mirror of
https://github.com/azures04/crafatar.git
synced 2026-03-22 07:51:17 +01:00
prevent large images
This commit is contained in:
parent
fbbbdf02f6
commit
77bcf9dbe7
@ -9,10 +9,8 @@ var valid_uuid = /^[0-9a-f]{32}$/;
|
|||||||
router.get('/:uuid/:size?', function(req, res) {
|
router.get('/:uuid/:size?', function(req, res) {
|
||||||
var uuid = req.param('uuid');
|
var uuid = req.param('uuid');
|
||||||
var size = req.param('size') || 180;
|
var size = req.param('size') || 180;
|
||||||
// Add temporary restriction to prevent app from crashing
|
// Prevent app from crashing/freezing
|
||||||
if (size <= 0) {
|
if (size <= 0 || size > 512) size = 180;
|
||||||
size = 180;
|
|
||||||
}
|
|
||||||
console.log(uuid);
|
console.log(uuid);
|
||||||
if (valid_uuid.test(uuid)) {
|
if (valid_uuid.test(uuid)) {
|
||||||
var filename = uuid + ".png";
|
var filename = uuid + ".png";
|
||||||
|
|||||||
@ -19,7 +19,7 @@ block content
|
|||||||
| ">
|
| ">
|
||||||
p(style="margin-top: 10px;") Example: UUID: '2d5aa9cdaeb049189930461fc9b91cc5', Username: Jake0oo0
|
p(style="margin-top: 10px;") Example: UUID: '2d5aa9cdaeb049189930461fc9b91cc5', Username: Jake0oo0
|
||||||
.well <img src="https://skins.jake0oo0.me/avatars/2d5aa9cdaeb049189930461fc9b91cc5">
|
.well <img src="https://skins.jake0oo0.me/avatars/2d5aa9cdaeb049189930461fc9b91cc5">
|
||||||
p(style="margin-top: 10px;") There is also an option to include a size, default is 180x180px.
|
p(style="margin-top: 10px;") There is also an option to include a size, default is 180x180px. The size may not be larger than 512px.
|
||||||
.well
|
.well
|
||||||
| <img src="https://skins.jake0oo0.me/avatars/
|
| <img src="https://skins.jake0oo0.me/avatars/
|
||||||
mark.green uuid
|
mark.green uuid
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user