mirror of
https://github.com/azures04/crafatar.git
synced 2026-03-22 16:01:16 +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) {
|
||||
var uuid = req.param('uuid');
|
||||
var size = req.param('size') || 180;
|
||||
// Add temporary restriction to prevent app from crashing
|
||||
if (size <= 0) {
|
||||
size = 180;
|
||||
}
|
||||
// Prevent app from crashing/freezing
|
||||
if (size <= 0 || size > 512) size = 180;
|
||||
console.log(uuid);
|
||||
if (valid_uuid.test(uuid)) {
|
||||
var filename = uuid + ".png";
|
||||
|
||||
@ -19,7 +19,7 @@ block content
|
||||
| ">
|
||||
p(style="margin-top: 10px;") Example: UUID: '2d5aa9cdaeb049189930461fc9b91cc5', Username: Jake0oo0
|
||||
.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
|
||||
| <img src="https://skins.jake0oo0.me/avatars/
|
||||
mark.green uuid
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user