-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored oembed controller data validation
refs #10060 - Uses validation layer for checking url data on oembed requests - Fixes typo in comment
- Loading branch information
1 parent
27bf453
commit 5f9f5ea
Showing
4 changed files
with
18 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const Promise = require('bluebird'); | ||
const common = require('../../../../../lib/common'); | ||
|
||
module.exports = { | ||
read(apiConfig, frame) { | ||
if (!frame.data.url || !frame.data.url.trim()) { | ||
return Promise.reject(new common.errors.BadRequestError({ | ||
message: common.i18n.t('errors.api.oembed.noUrlProvided') | ||
})); | ||
} | ||
} | ||
}; |