Blog
Services
Docs
Donate
Status
English
Bahasa Indonesia
Deutsch
English
Español
Esperanto
Filipino
Français
Italiano
Latviešu
Magyar nyelv
Nederlands
Plattdüütsch
Polski
Português de Portugal
Português do Brasil
Slovenščina
Suomi
Svenska
Türkçe
Čeština
Ελληνικά
Български
Русский
Українська
فارسی
日本語
简体中文
繁體中文(台灣)
繁體中文(香港)
한국어
Ark
Search
Create
Migrate
Explore
Login
Blog
Docs
Status
Explore
Login
Ark
Infrastructure
/
ghost
Watch
0
Fork
You've already forked ghost
0
mirror of
https://github.com/TryGhost/Ghost.git
synced
2025-01-27 22:49:56 -05:00
Code
Issues
Activity
3004e03bc6
ghost
/
core
/
server
/
middleware
/
validation
/
index.js
3 lines
81 B
JavaScript
Raw
Normal View
History
Unescape
Escape
feature: upload validation middleware (#7208) no issue - Source out validation logic into a upload validation middleware for all upload types (csv, image, subscribers). This unit can be later used for Ghost 1.0 as a pre validation core unit. - More usage of route tests than controller tests. These are use case tests, a use case only changes if the product changes
2016-08-18 21:25:51 +02:00
exports
.
upload
=
require
(
'./upload'
)
;
✅ Blog icon validations (#7893) refs #7688 Adds an `uploads/icon/` endpoint to the api route to get a seperate entry point for blog icon validations. The blog icon validation will specifically check for images which have icon extensions (`.ico` & `.png`) and throw errors if: - the icon file size is too big (>100kb) - the icon is not a squaer - the icon size is smaller than 32px - the icon size is larger than 1000px - the icon is not `.ico` or `.png` extension TODOs for this PR: - [X] get image dimensions - [X] validate for image - [X] size - [X] form (must be square) - [X] type - [X] dimenstion (min 32px and max 1,000px) - [X] return appropriate error messages - [X] write tests -------------------- TODOs for #7688: - [X] Figure out, which favicon should be used (uploaded or default) -> #7713 - [ ] Serve and redirect the favicon for any browser requests, incl. redirects -> #7700 [WIP] - [X] Upload favicon via `general/settings` and implement basic admin validations -> TryGhost/Ghost-Admin#397 - [X] Build server side validations -> this PR
2017-01-26 16:01:52 +07:00
exports
.
blogIcon
=
require
(
'./blog-icon'
)
;
Reference in a new issue
Copy permalink