More test + fix decodeURIComponent call
Previously I was calling decodeURIComponent on regex match result which was an array. This fixes that and alos adds more tests
This commit is contained in:
@@ -24,9 +24,9 @@
|
||||
<script src='lib/swagger-oauth.js' type='text/javascript'></script>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var url = decodeURIComponent(window.location.search.match(/url=([^&]+)/));
|
||||
var url = window.location.search.match(/url=([^&]+)/);
|
||||
if (url && url.length > 1) {
|
||||
url = url[1];
|
||||
url = decodeURIComponent(url[1]);
|
||||
} else {
|
||||
url = "http://petstore.swagger.wordnik.com/v2/swagger.json";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user