ProjectParam returns the project query parameter from the given request or "default" if parameter is not set.
(request *http.Request)
| 10 | |
| 11 | // ProjectParam returns the project query parameter from the given request or "default" if parameter is not set. |
| 12 | func ProjectParam(request *http.Request) string { |
| 13 | projectParam := QueryParam(request, "project") |
| 14 | if projectParam == "" { |
| 15 | projectParam = api.ProjectDefaultName |
| 16 | } |
| 17 | |
| 18 | return projectParam |
| 19 | } |
| 20 | |
| 21 | // QueryParam extracts the given query parameter directly from the URL, never from an |
| 22 | // encoded body. |
no test coverage detected
searching dependent graphs…