Handle requests without URI

This commit is contained in:
Yarmo Mackenbach 2021-03-05 16:59:28 +01:00
parent bd7bee7aff
commit 6b40902a8f
No known key found for this signature in database
GPG key ID: 37367F4AF4087AD1

View file

@ -72,6 +72,10 @@ const match = (uri, opts) => {
const directRequestHandler = (spData, opts) => { const directRequestHandler = (spData, opts) => {
return new Promise(async (resolve, reject) => { return new Promise(async (resolve, reject) => {
const url = spData.proof.fetch ? spData.proof.fetch : spData.proof.uri const url = spData.proof.fetch ? spData.proof.fetch : spData.proof.uri
if (!url) {
reject('No valid URI provided')
return
}
let res let res
switch (spData.proof.format) { switch (spData.proof.format) {