Skip to content

fixes issue where requesting a different format of a jsonld resource crashed the server#474

Merged
dmitrizagidulin merged 2 commits into
nodeSolidServer:masterfrom
Yodata:fix-parse
Dec 22, 2016
Merged

fixes issue where requesting a different format of a jsonld resource crashed the server#474
dmitrizagidulin merged 2 commits into
nodeSolidServer:masterfrom
Yodata:fix-parse

Conversation

@ryankeener
Copy link
Copy Markdown
Contributor

When setting the accept header to something other than application/ld+json for .jsonld resources the server would crash with the following error:

     Uncaught TypeError: callback is not a function
      at Object.tripleCallback [as _callback] (node_modules/rdflib/lib/parse.js:112:7)
      at Object.N3Parser._readInTopContext (node_modules/n3/lib/N3Parser.js:81:19)
      at node_modules/n3/lib/N3Parser.js:683:35
      at Object.N3Lexer._tokenizeToEnd (node_modules/n3/lib/N3Lexer.js:80:11)
      at Immediate._onImmediate (node_modules/n3/lib/N3Lexer.js:318:38)

Based on this comment it looks like the function signature may have changed somewhere along the way to be async?
https://github.com/linkeddata/rdflib.js/blame/master/src/parse.js#L17

@dmitrizagidulin
Copy link
Copy Markdown
Contributor

Thanks @ryankeener! Good catch on the callback.

Copy link
Copy Markdown
Contributor

@dmitrizagidulin dmitrizagidulin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@dmitrizagidulin dmitrizagidulin merged commit b6e6d9e into nodeSolidServer:master Dec 22, 2016
@ryankeener ryankeener deleted the fix-parse branch December 22, 2016 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants