==== 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`
- https://f1000research-files.f1000.com/manuscripts/182974/9cac4dca-d953-49fa-b983-e3bb1846a17e_f1000res166104.pdf?doi=10.12688/f1000research.166104.1&gtmKey=GTM-MWFK8L5J&gtmAuth=hzk0Vc3qFsQYhCrIoHz68A&gtmPreview=env-1&immUserUrl=https%3A%2F%2Ff1r-proxy.f1krdev.com%2Feditor%2Fmember%2Fshow%2F&otid=1bc074d1-3db4-47ed-9f80-df1a4a3f2ab4&s3BucketUrl=https%3A%2F%2Ff1000research-files.f1000.com&submissionUrl=%2Ffor-authors%2Fpublish-your-research&transcendEnv=cm&transcendId=ef49a3f1-d8c1-47d6-88fc-50e41130631f&numberOfBrowsableCollections=74&numberOfBrowsableInstitutionalCollections=7&numberOfBrowsableGateways=48
Works online but is an actually a pdf
- https://onlinelibrary.wiley.com/action/downloadSupplement?doi=10.1002%2Ftax.12597&file=tax12597-sup-0002-FigureS1.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
[[ https://logstash.wikimedia.org/goto/e7123f38a98a784dc5ddff486dbbf85f | Dashboard ]] that shows successful requests ( status 200 ) but the actual contentType could be detected as PDF
[[ https://logstash.wikimedia.org/goto/db8eb9316f939ff371e49b8d071f062d | 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 )