linked-data-dotnet/json-ld.net

Parsing ContentType is too restrictive

Closed this issue · 4 comments

DocumentLoader::LoadDocument() tries to validate that the media type is JSON-LD. However, the check is too strict: it only passes if the content type is equal to "application/ld+json". This excludes other valid strings like "application/ld+json; charset=utf-8". Specifying the charset is very common for users who create their response messages using System.Net.Http.dll (e.g., using StringContent).

An easy fix is to replace equality check with "StartsWith()".

stale commented

This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs. Thank you for your contributions.

Reconsidering as part of #60

Should be implemented in conjunction with #21

stale commented

This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs. Thank you for your contributions.