question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Reports wrong content-type for "plain-CWL" type, missing character encoding

See original GitHub issue

https://staging.dockstore.org:8443/api/ga4gh/v1/tools/quay.io%2Fcollaboratory%2Fdockstore-tool-bwa-samse/versions/master/plain-CWL/descriptor

HTTP/1.1 200 OK
Date: Tue, 16 Aug 2016 22:27:06 GMT
Content-Type: application/json
Vary: Accept-Encoding
Content-Length: 1810

The content type should probably be text/plain. Application/json is definitely wrong. Unfortunately, there doesn’t appear to be standard mime type for YAML, there are a few different conventions in use (https://stackoverflow.com/questions/332129/yaml-mime-type).

Per the CWL spec, CWL files should be encoded UTF-8. The headers should explicitly supply this as the character encoding.

This is a blocker issue, using the Python requests library to fetch the above link gets decoded using the wrong character set, which has the effect of causing the YAML parser to fail.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
tetroncommented, Aug 17, 2016

So, when the client provides Accept: */* (which is the default for both requests and curl and probably many other http client libraries), dockstore returns application/json as the content-type for plain-CWL (which seems wrong) and no character set. I am proposing that the content-type returned for Accept: */* and plain-CWL should be:

Content-Type: text/plain; charset=utf-8
0reactions
denis-yuencommented, Aug 31, 2016

Verified behaviour on staging

Read more comments on GitHub >

github_iconTop Results From Across the Web

Reports wrong content-type for "plain-CWL" type, missing ...
Per the CWL spec, CWL files should be encoded UTF-8. The headers should explicitly supply this as the character encoding. This is a...
Read more >
What does "Content-type: application/json; charset=utf-8 ...
Content-type : application/json; charset=utf-8 designates the content to be in JSON format, encoded in the UTF-8 character encoding. Designating the encoding ...
Read more >
Declaring character encodings in HTML - W3C
Use character encoding declarations in HTTP headers if it makes sense, and if you are able, for any type of content, but in...
Read more >
Solved: Create a .csv file that uses UTF-8 character encod...
Solved: Hello, as the title of the subject already suggests: I want to create a .csv file that uses UTF-8 character encoding. The...
Read more >
Email Encoding: Setting Content-Type and HTML Spcecial ...
Content-Type plays a major role in the way an email is displayed. Learn about Content-Type character encoding and how to use it in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found