Skip to content

Commit

Permalink
add https protocol if first_request is https
Browse files Browse the repository at this point in the history
  • Loading branch information
binux committed Mar 26, 2017
1 parent 81cf503 commit 212782c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion web/static/har/entry_list.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ define (require, exports, module) ->
try
$scope.setting ?= {}
$scope.setting.sitename ?= first_entry and utils.get_domain(first_entry.request.url).split('.')[0]
$scope.setting.siteurl ?= first_entry and utils.url_parse(first_entry.request.url).host
parsed_url = first_entry and utils.url_parse(first_entry.request.url)
$scope.setting.siteurl ?= parsed_url.protocol == 'https:' and "#{parsed_url.protocol}//#{parsed_url.host}" or parsed_url.host
catch error
console.error(error)

Expand Down
5 changes: 3 additions & 2 deletions web/static/har/entry_list.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion web/tpl/task_new_var.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{%- set var_lower = var.lower() %}
{%- if var_lower == 'username' %}用户名
{%- elif var_lower == 'password' %}密码
{%- elif var_lower == 'cookie' %}<span>Cookies</span>{% if tpl.siteurl %}<a href="javascript:void(0)" class="control-helper" data-toggle="get-cookie" data-site="{{ asurl(tpl.siteurl) }}" data-cookie="" disabled>点击获取</a>{% endif %}
{%- elif var_lower == 'cookie' or var_lower == 'cookies' %}<span>Cookies</span>{% if tpl.siteurl %}<a href="javascript:void(0)" class="control-helper" data-toggle="get-cookie" data-site="{{ asurl(tpl.siteurl) }}" data-cookie="" disabled>点击获取</a>{% endif %}
{%- else %}{{ var }}
{%- endif -%}
{% endmacro %}
Expand Down

0 comments on commit 212782c

Please sign in to comment.