Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Proxy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
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
open-source
Proxy
Commits
6280cb20
Commit
6280cb20
authored
2 years ago
by
Dominik Hebeler
Browse files
Options
Downloads
Patches
Plain Diff
fixed url as route parameter encoding
parent
b10dae46
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
proxy/app/Http/Controllers/ProxyController.php
+8
-1
8 additions, 1 deletion
proxy/app/Http/Controllers/ProxyController.php
with
8 additions
and
1 deletion
proxy/app/Http/Controllers/ProxyController.php
+
8
−
1
View file @
6280cb20
...
...
@@ -373,6 +373,10 @@ class ProxyController extends Controller
*/
public
function
formget
(
Request
$request
,
$password
,
$validUntil
,
$url
)
{
// Since url is a route parameter the URL is encoded with bin2hex function
// Reverse the encoding:
$url
=
pack
(
"H*"
,
$url
);
if
(
empty
(
$password
)
||
empty
(
$validUntil
)
||
empty
(
$url
))
{
abort
(
400
,
"Invalid Request"
);
}
...
...
@@ -507,8 +511,11 @@ class ProxyController extends Controller
$validUntil
=
self
::
generateValidUntilDate
();
$password
=
self
::
generatePassword
(
$url
,
$validUntil
);
// url will be a route parameter and might contain unsupported characters
// to make the parameter alphanumeric encoding it with bin2hex should do the trick
// It can later be decoded with pack("H*", $hex_value)
$parameters
=
[
"url"
=>
$url
,
"url"
=>
bin2hex
(
$url
)
,
"validUntil"
=>
$validUntil
,
"password"
=>
$password
,
];
...
...
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