diff options
author | Case Duckworth | 2020-05-30 16:54:30 -0500 |
---|---|---|
committer | Case Duckworth | 2020-05-30 16:54:30 -0500 |
commit | e31ba53ca571e917f2b6c885449e9f2731b90988 (patch) | |
tree | 39b240716828ed630b0d7dc54c6d2a1d34d8c85f | |
parent | Update docs (diff) | |
download | bollux-e31ba53ca571e917f2b6c885449e9f2731b90988.tar.gz bollux-e31ba53ca571e917f2b6c885449e9f2731b90988.zip |
Remove port number from parsed authority
When navigating to a link with the port included, request_url doesn't do the right thing. For now I've changed the code in transform_resource to remove the port from the authority field, but that is probably not the right place to put it. I'm going to deal with this later though.
-rwxr-xr-x | bollux | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/bollux b/bollux index c938abe..2e0aa0e 100755 --- a/bollux +++ b/bollux | |||
@@ -206,7 +206,8 @@ transform_resource() { # transform_resource BASE_URL REFERENCE_URL | |||
206 | # cf. 5.3 -- recomposition | 206 | # cf. 5.3 -- recomposition |
207 | local r="" | 207 | local r="" |
208 | isdefined "T[scheme]" && r="$r${T[scheme]}:" | 208 | isdefined "T[scheme]" && r="$r${T[scheme]}:" |
209 | isdefined "T[authority]" && r="$r//${T[authority]}" | 209 | # remove the port from the authority |
210 | isdefined "T[authority]" && r="$r//${T[authority]%:*}" | ||
210 | r="$r${T[path]}" | 211 | r="$r${T[path]}" |
211 | isdefined T[query] && r="$r?${T[query]}" | 212 | isdefined T[query] && r="$r?${T[query]}" |
212 | isdefined T[fragment] && r="$r#${T[fragment]}" | 213 | isdefined T[fragment] && r="$r#${T[fragment]}" |
@@ -343,7 +344,10 @@ handle_response() { | |||
343 | REDIRECTS=0 | 344 | REDIRECTS=0 |
344 | die "$((100 + code))" "$code" | 345 | die "$((100 + code))" "$code" |
345 | ;; | 346 | ;; |
346 | *) die "$((100 + code)) Unknown response code: $code." ;; | 347 | *) |
348 | [[ -z "${code-}" ]] && die 100 "Empty response code." | ||
349 | die "$((100 + code)) Unknown response code: $code." | ||
350 | ;; | ||
347 | esac | 351 | esac |
348 | } | 352 | } |
349 | 353 | ||