diff --git a/src/ecmascript/quickjs/location.c b/src/ecmascript/quickjs/location.c index 2cce20d7d..4a4590e75 100644 --- a/src/ecmascript/quickjs/location.c +++ b/src/ecmascript/quickjs/location.c @@ -94,7 +94,7 @@ js_location_get_property_host(JSContext *ctx, JSValueConst this_val) return JS_EXCEPTION; } - char *str = get_uri_string(vs->uri, URI_HOST | URI_PORT); + char *str = get_uri_string(vs->uri, URI_HOST_PORT); if (!str) { #ifdef ECMASCRIPT_DEBUG diff --git a/src/ecmascript/spidermonkey/location.c b/src/ecmascript/spidermonkey/location.c index 089bedae0..c4be4ac1c 100644 --- a/src/ecmascript/spidermonkey/location.c +++ b/src/ecmascript/spidermonkey/location.c @@ -205,7 +205,7 @@ location_get_property_host(JSContext *ctx, unsigned int argc, JS::Value *vp) return false; } - char *str = get_uri_string(vs->uri, URI_HOST | URI_PORT); + char *str = get_uri_string(vs->uri, URI_HOST_PORT); if (!str) { #ifdef ECMASCRIPT_DEBUG diff --git a/src/protocol/uri.h b/src/protocol/uri.h index 7d5e9dcff..164b78be1 100644 --- a/src/protocol/uri.h +++ b/src/protocol/uri.h @@ -171,6 +171,8 @@ enum uri_component { /* Used for getting the URI with no #fragment */ URI_BASE = ~(URI_RARE | URI_FRAGMENT) | URI_POST, + URI_BASE_FRAGMENT = URI_BASE | URI_FRAGMENT, + /* Used for getting data-less URI (stuff only up to the slash). */ URI_SERVER = ~(URI_RARE | URI_DATA | URI_FRAGMENT), @@ -197,6 +199,8 @@ enum uri_component { * URI_PORT. */ URI_DNS_HOST = URI_HOST | URI_IDN, + URI_HOST_PORT = URI_HOST | URI_PORT, + /* Used for adding the unproxied URI and encode it using IDN to string */ URI_PROXY = ~(URI_RARE | URI_FRAGMENT) | URI_IDN, diff --git a/src/session/task.c b/src/session/task.c index ac2d76df0..6ff9d5693 100644 --- a/src/session/task.c +++ b/src/session/task.c @@ -654,7 +654,7 @@ follow_url(struct session *ses, struct uri *uri, char *target, static int follow_url_event_id = EVENT_NONE; char *uristring; - uristring = uri && !uri->post ? get_uri_string(uri, URI_BASE | URI_FRAGMENT) + uristring = uri && !uri->post ? get_uri_string(uri, URI_BASE_FRAGMENT) : NULL; /* Do nothing if we do not have a URI or if it is a POST request