Commit 3944da82 authored by Marcel Amirault's avatar Marcel Amirault

Merge branch 'JonstonChan-quote-curl-urls' into 'master'

Quote URLs in cURL command

See merge request gitlab-org/gitlab!69576
parents 580148e7 6a6968bb
......@@ -10,4 +10,4 @@ link: https://docs.gitlab.com/ee/development/documentation/restful_api_styleguid
level: error
scope: code
raw:
- 'curl.*[^"=]https?://.*'
- 'curl [^"]+://.*'
......@@ -38,14 +38,14 @@ GET projects/:id/packages/helm/:channel/index.yaml
```shell
curl --user <username>:<personal_access_token> \
https://gitlab.example.com/api/v4/projects/1/packages/helm/stable/index.yaml
"https://gitlab.example.com/api/v4/projects/1/packages/helm/stable/index.yaml"
```
Write the output to a file:
```shell
curl --user <username>:<personal_access_token> \
https://gitlab.example.com/api/v4/projects/1/packages/helm/stable/index.yaml \
"https://gitlab.example.com/api/v4/projects/1/packages/helm/stable/index.yaml" \
--remote-name
```
......@@ -67,7 +67,7 @@ GET projects/:id/packages/helm/:channel/charts/:file_name.tgz
```shell
curl --user <username>:<personal_access_token> \
https://gitlab.example.com/api/v4/projects/1/packages/helm/stable/charts/mychart.tgz \
"https://gitlab.example.com/api/v4/projects/1/packages/helm/stable/charts/mychart.tgz" \
--remote-name
```
......@@ -91,5 +91,5 @@ POST projects/:id/packages/helm/api/:channel/charts
curl --request POST \
--form 'chart=@mychart.tgz' \
--user <username>:<personal_access_token> \
https://gitlab.example.com/api/v4/projects/1/packages/helm/api/stable/charts
"https://gitlab.example.com/api/v4/projects/1/packages/helm/api/stable/charts"
```
......@@ -725,7 +725,7 @@ Example request:
```shell
curl --request POST \
--url http://localhost:3000/api/v4/namespaces/123/minutes \
--url "http://localhost:3000/api/v4/namespaces/123/minutes" \
--header 'Content-Type: application/json' \
--header 'PRIVATE-TOKEN: <admin access token>' \
--data '{
......@@ -769,7 +769,7 @@ Example request:
```shell
curl --request PATCH \
--url http://localhost:3000/api/v4/namespaces/123/minutes/move/321 \
--url "http://localhost:3000/api/v4/namespaces/123/minutes/move/321" \
--header 'PRIVATE-TOKEN: <admin access token>'
```
......
......@@ -125,7 +125,7 @@ Example request that uses HTTP Basic authentication:
```shell
curl --user "user:<your_access_token>" \
https://gitlab.example.com/api/v4/projects/24/packages/generic/my_package/0.0.1/file.txt
"https://gitlab.example.com/api/v4/projects/24/packages/generic/my_package/0.0.1/file.txt"
```
## Publish a generic package by using CI/CD
......
......@@ -392,9 +392,9 @@ upload:
- if: $CI_COMMIT_TAG
script:
- |
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file bin/${DARWIN_AMD64_BINARY} ${PACKAGE_REGISTRY_URL}/${DARWIN_AMD64_BINARY}
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file bin/${DARWIN_AMD64_BINARY} "${PACKAGE_REGISTRY_URL}/${DARWIN_AMD64_BINARY}"
- |
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file bin/${LINUX_AMD64_BINARY} ${PACKAGE_REGISTRY_URL}/${LINUX_AMD64_BINARY}
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file bin/${LINUX_AMD64_BINARY} "${PACKAGE_REGISTRY_URL}/${LINUX_AMD64_BINARY}"
release:
# Caution, as of 2021-02-02 these assets links require a login, see:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment