Skip to content

Commit

Permalink
Update rdflib to 0.17.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
RubenVerborgh committed Sep 3, 2018
1 parent a527c49 commit cc5301d
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 109 deletions.
169 changes: 70 additions & 99 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"kvplus-files": "0.0.4",
"li": "^1.3.0",
"node-fetch": "^2.1.2",
"rdflib": "0.16.7",
"rdflib": "^0.17.1",
"valid-url": "^1.0.9"
},
"devDependencies": {
Expand Down
12 changes: 5 additions & 7 deletions src/preferred-provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,14 @@ function discoverFromProfile (webId) {

return fetcher.load(webId, { force: true })
.then(response => {
if (!response.ok) {
let error = new Error(`Could not reach Web ID ${webId} to discover provider`)
error.statusCode = 400
throw error
}

let providerTerm = rdf.namedNode('http://www.w3.org/ns/solid/terms#oidcIssuer')
let providerUri = store.anyValue(rdf.namedNode(webId), providerTerm)

return providerUri
}, err => {
let error = new Error(`Could not reach Web ID ${webId} to discover provider`)
error.cause = err
error.statusCode = 400
throw error
})
}

Expand Down
4 changes: 2 additions & 2 deletions test/unit/preferred-provider-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ describe('preferred-provider.js', () => {

it('should throw an error if web id is unreachable', done => {
nock(serverUri)
.options('/')
.reply(404)
.get('/').reply(404)
.options('/').reply(404)

provider.discoverProviderFor(webId)
.catch(err => {
Expand Down

0 comments on commit cc5301d

Please sign in to comment.