Snippets do not accurately reproduce the exact characters that were entered (tabs are replaced by spaces)
<!--IssueSummary start--> <details> <summary> Everyone can contribute. [Help move this issue forward](https://handbook.gitlab.com/handbook/marketing/developer-relations/contributor-success/community-contributors-workflows/#contributor-links) while earning points, leveling up and collecting rewards. </summary> - [Close this issue](https://contributors.gitlab.com/manage-issue?action=close&projectId=278964&issueIid=377697) </details> <!--IssueSummary end--> ### Summary Sometimes it is critical that what we enter into a snippet is accurately represented. In this case, it is a shell script with a heredoc: ```bash cat <<-EOF -->a line of text -->another line of text -->EOF ``` However, when this snippet is downloaded using curl, the tabs are no longer present and the script fails. ### Steps to reproduce 1. Create a snippet containing: ```bash #!/bin/bash cat <<-EOF -->a line of text -->another line of text -->EOF ``` Where --> is a literal tab character. 2. Download the snippet using curl. It doesn't matter how it is saved -o -O or redirect to a file. `curl "https://gitlab.com/api/v4/projects/:id/snippets/:id/raw" --header "PRIVATE-TOKEN: your_token"` 3. Run the script, it will fail because of the missing tab characters You can examine the file and see that the tabs have been changed to spaces. I am currently working around this by doing: cat -t myfile.sh and taking that output and pasting it into the snippet. Then when I download the script I pipe it through sed to convert back the tabs `curl "https://gitlab.com/api/v4/projects/:id/snippets/:id/raw" --header "PRIVATE-TOKEN: your_token" | sed -r 's/\^I/\t/g' > myfile.sh`
issue