common-workflow-language / common-workflow-language/schema_salad

Unexpected Error due to Duplicate `Content-Type` Headers in `cwltool`

Open
#747 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
86
Forks
64
Avg merge
19h 24m
Merged PRs (30d)
19

Description

When I run the following command with the latest version of `cwltool`:

```bash
$ cwltool https://sandbox.zenodo.org/record/1016630/files/trimming_and_qc.cwl --help
```

I encounter the error below:

```bash
While fetching https://sandbox.zenodo.org/record/1016630/files/trimming_and_qc.cwl, got content-type of 'application/octet-stream, application/octet-stream'. Expected one of ['text/plain', 'application/json', 'text/vnd.yaml', 'text/yaml', 'text/x-yaml', 'application/x-yaml', 'application/octet-stream'].
```

I thought this might be related to the fix I provided in the past at:

https://github.com/common-workflow-language/cwltool/pull/1622

However, upon closer inspection, I noticed that the content-type is duplicated: `application/octet-stream, application/octet-stream`.

I fetched the actual headers using `curl`, and observed:

```bash
$ curl -D - https://sandbox.zenodo.org/record/1016630/files/trimming_and_qc.cwl
...
Content-Type: application/octet-stream
...
Content-Type: application/octet-stream
...
```

It seems there are two Content-Type lines.

I suspect the code around:
https://github.com/common-workflow-language/schema_salad/blob/e16612a7cf2d6cd9138aafdec20958452be3b611/schema_salad/fetcher.py#L75

might be related to this issue, but I'm not sure about the exact solution. Could you please look into this?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.