From 24149b3d0c70976b7d480ba08c122e1d8f1090ff Mon Sep 17 00:00:00 2001 From: Kanezoh Date: Sat, 12 Jun 2021 23:10:56 +0900 Subject: [PATCH] resolve uri path --- src/mechanize/form.cr | 1 + src/mechanize/http/agent.cr | 1 + 2 files changed, 2 insertions(+) diff --git a/src/mechanize/form.cr b/src/mechanize/form.cr index 6a2226f..be3334f 100644 --- a/src/mechanize/form.cr +++ b/src/mechanize/form.cr @@ -82,6 +82,7 @@ class MechanizeCr::Form end successful_controls.each do |ctrl| value = ctrl.query_value + next if value[0] == "" query.push(value) end query diff --git a/src/mechanize/http/agent.cr b/src/mechanize/http/agent.cr index 03f1dd6..40d0104 100644 --- a/src/mechanize/http/agent.cr +++ b/src/mechanize/http/agent.cr @@ -93,6 +93,7 @@ module MechanizeCr referer_uri = current_page.uri host = referer_uri.host scheme = referer_uri.scheme + uri = "/" + uri unless uri[0] == '/' new_uri = URI.new(scheme: scheme, host: host, path: uri) end end