Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
tank
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AURA
tank
Commits
04ce8064
Verified
Commit
04ce8064
authored
6 months ago
by
Ernesto Rico Schmidt
Browse files
Options
Downloads
Patches
Plain Diff
fix: correctly refer to the showId when passed as query parameter
parent
cd709e14
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
api/v1/files_upload.go
+1
-1
1 addition, 1 deletion
api/v1/files_upload.go
api/v1/playlists.go
+1
-1
1 addition, 1 deletion
api/v1/playlists.go
api/v1/utils.go
+2
-2
2 additions, 2 deletions
api/v1/utils.go
with
4 additions
and
4 deletions
api/v1/files_upload.go
+
1
−
1
View file @
04ce8064
...
...
@@ -480,7 +480,7 @@ func (api *API) UploadFileFlowJS(c *gin.Context) {
// @Failure 500 {object} ErrorResponse
// @Router /api/v1/files/{id}/upload [get]
func
(
api
*
API
)
TestFileFlowJS
(
c
*
gin
.
Context
)
{
showID
,
err
:=
idFromString
(
c
.
Query
(
"show
-i
d"
))
showID
,
err
:=
idFromString
(
c
.
Query
(
"show
I
d"
))
// showId is passed as a query parameter
if
err
!=
nil
{
c
.
JSON
(
http
.
StatusBadRequest
,
ErrorResponse
{
Error
:
"invalid showId: "
+
err
.
Error
()})
}
...
...
This diff is collapsed.
Click to expand it.
api/v1/playlists.go
+
1
−
1
View file @
04ce8064
...
...
@@ -227,7 +227,7 @@ func (api *API) ReadPlaylist(c *gin.Context) {
return
}
showID
,
_
:=
idFromString
(
c
.
Query
(
"show
-i
d"
))
// we ignore error because the showId is an optional query parameter
showID
,
_
:=
idFromString
(
c
.
Query
(
"show
I
d"
))
// we ignore error because the showId is an optional query parameter
if
showID
!=
0
{
playlist
,
err
:=
api
.
store
.
GetPlaylist
(
showID
,
id
)
...
...
This diff is collapsed.
Click to expand it.
api/v1/utils.go
+
2
−
2
View file @
04ce8064
...
...
@@ -209,8 +209,8 @@ func authorizeRequestForPlaylist(c *gin.Context, playlistID uint64, api *API) (b
}
func
authorizeRequest
(
c
*
gin
.
Context
,
api
*
API
)
(
bool
,
*
auth
.
Session
)
{
// show
-i
d is passed as query parameter
if
showID
,
_
:=
idFromString
(
c
.
Query
(
"show
-i
d"
));
showID
!=
0
{
// show
I
d is passed as query parameter
if
showID
,
_
:=
idFromString
(
c
.
Query
(
"show
I
d"
));
showID
!=
0
{
return
authorizeRequestForShow
(
c
,
showID
)
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment