ASF Bugzilla – Attachment 5943 Details for
Bug 19207
Redirection broken under IPv6
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
proposed patch for PR 19207 (build URL from IPv6 literal)
pr19207.patch (text/plain), 1.28 KB, created by
Jeff Trawick
on 2003-04-22 11:46:07 UTC
(
hide
)
Description:
proposed patch for PR 19207 (build URL from IPv6 literal)
Filename:
MIME Type:
Creator:
Jeff Trawick
Created:
2003-04-22 11:46:07 UTC
Size:
1.28 KB
patch
obsolete
>Index: server/core.c >=================================================================== >RCS file: /home/cvs/httpd-2.0/server/core.c,v >retrieving revision 1.231 >diff -u -r1.231 core.c >--- server/core.c 3 Feb 2003 17:53:18 -0000 1.231 >+++ server/core.c 22 Apr 2003 11:41:53 -0000 >@@ -885,6 +885,23 @@ > return r->server->server_hostname; > } > >+/* >+ * Get the current server name from the request for the purposes >+ * of using in a URL. If the server name is an IPv6 literal >+ * address, it will be returned in URL format (e.g., "[fe80::1]"). >+ */ >+static const char *get_server_name_for_url(request_rec *r) >+{ >+ const char *plain_server_name = ap_get_server_name(r); >+ >+#ifdef APR_HAVE_IPV6 >+ if (ap_strchr_c(plain_server_name, ':')) { /* IPv6 literal? */ >+ return apr_psprintf(r->pool, "[%s]", plain_server_name); >+ } >+#endif >+ return plain_server_name; >+} >+ > AP_DECLARE(apr_port_t) ap_get_server_port(const request_rec *r) > { > apr_port_t port; >@@ -925,7 +942,7 @@ > request_rec *r) > { > unsigned port = ap_get_server_port(r); >- const char *host = ap_get_server_name(r); >+ const char *host = get_server_name_for_url(r); > > if (ap_is_default_port(port, r)) { > return apr_pstrcat(p, ap_http_method(r), "://", host, uri, NULL);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 19207
: 5943