forked from rundeck/rundeck
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix rundeck#1774 handle relative url redirect after authentication
- Loading branch information
Showing
2 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
core/src/test/groovy/com/dtolabs/client/utils/BaseFormAuthenticatorSpec.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.dtolabs.client.utils | ||
|
||
import org.apache.commons.httpclient.HttpMethod | ||
import spock.lang.Specification | ||
|
||
/** | ||
* Created by greg on 4/20/16. | ||
*/ | ||
class BaseFormAuthenticatorSpec extends Specification { | ||
def "absolute url"() { | ||
given: | ||
URL url = new URL("http", host, 8080, "/some/path") | ||
when: | ||
def result = BaseFormAuthenticator.absoluteUrl(url, location) | ||
then: | ||
result == expected | ||
|
||
where: | ||
host | location | expected | ||
"ahost" | '/monkey' | 'http://ahost:8080/monkey' | ||
"bhost" | '/monkey' | 'http://bhost:8080/monkey' | ||
"ahost" | 'http://ahost2:8080/abc' | 'http://ahost2:8080/abc' | ||
|
||
} | ||
} |