Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ai
sso
Commits
a65ad08e
Commit
a65ad08e
authored
Jun 20, 2019
by
ale
Browse files
Add a slash on the login redirect URL only when necessary
parent
210f1644
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/mod_sso/mod_sso.c
View file @
a65ad08e
...
...
@@ -490,6 +490,14 @@ static int mod_sso_method_handler(request_rec *r) {
return
DECLINED
;
}
static
int
ends_with_slash
(
const
char
*
s
)
{
int
l
=
strlen
(
s
);
if
(
l
<
1
)
{
return
0
;
}
return
s
[
l
-
1
]
==
'/'
;
}
static
int
redirect_to_login_server
(
request_rec
*
r
,
modsso_config
*
s_cfg
,
const
char
*
service_host
,
const
char
*
service
,
const
char
**
groups
,
...
...
@@ -499,7 +507,8 @@ static int redirect_to_login_server(request_rec *r, modsso_config *s_cfg,
dest
=
full_uri
(
r
,
service_host
);
login_url
=
apr_pstrcat
(
r
->
pool
,
"https://"
,
s_cfg
->
login_server
,
"/?s="
,
modsso_url_encode
(
r
->
pool
,
service
),
ends_with_slash
(
s_cfg
->
login_server
)
?
""
:
"/"
,
"?s="
,
modsso_url_encode
(
r
->
pool
,
service
),
"&d="
,
modsso_url_encode
(
r
->
pool
,
dest
),
NULL
);
if
(
s_cfg
->
session_key
!=
NULL
)
{
// If we have a session key, send a nonce to the login server. We
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment