Context
We want to understand better how often users link to a PDF source and can use it for the autogeneration. Since Citoid does use different approaches to convert an URL to a citation with metadata it would be helpful to get the type of the source early on for logging.
Implementation
- Check the contentType from the header of the source as early as possible to add the flag to the logging output.
Examples
Works online but is an actually application/octet-stream
Works online but is an actually a pdf
Outcome and Notes
- We're now logging the sourceContentType when resolving a request
- There will be cases where the source URL can't be called because it blocks the request for Anti-Spam reasons
- These cases could still be successful because there might be a DOI detected in the URL that can be resolved elsewhere
- The sourceContentType will be an empty string then, because the service can't say for sure if the URL actually leads to a pdf source
Logstash outcome
Dashboard that shows successful requests ( status 200 ) but the actual contentType could be detected as PDF
Dashboard that shows failed requests ( status 415 ) and the actual contentType could be detected as PDF ( so we could download the PDF or open it in a browser )