git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] remove protocol from gravatar and picon links for clear if Gitweb is being called through a secure server
@ 2013-01-28 19:14 Andrej Andb
  2013-01-28 20:58 ` Jonathan Nieder
  0 siblings, 1 reply; 10+ messages in thread
From: Andrej Andb @ 2013-01-28 19:14 UTC (permalink / raw)
  To: git; +Cc: Andrej Andb

---
 gitweb/gitweb.perl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index c6bafe6..1309196 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -2068,7 +2068,7 @@ sub picon_url {
 	if (!$avatar_cache{$email}) {
 		my ($user, $domain) = split('@', $email);
 		$avatar_cache{$email} =
-			"http://www.cs.indiana.edu/cgi-pub/kinzler/piconsearch.cgi/" .
+			"//www.cs.indiana.edu/cgi-pub/kinzler/piconsearch.cgi/" .
 			"$domain/$user/" .
 			"users+domains+unknown/up/single";
 	}
@@ -2083,7 +2083,7 @@ sub gravatar_url {
 	my $email = lc shift;
 	my $size = shift;
 	$avatar_cache{$email} ||=
-		"http://www.gravatar.com/avatar/" .
+		"//www.gravatar.com/avatar/" .
 			Digest::MD5::md5_hex($email) . "?s=";
 	return $avatar_cache{$email} . $size;
 }
-- 
1.8.1.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] remove protocol from gravatar and picon links for clear if Gitweb is being called through a secure server
  2013-01-28 19:14 [PATCH] remove protocol from gravatar and picon links for clear if Gitweb is being called through a secure server Andrej Andb
@ 2013-01-28 20:58 ` Jonathan Nieder
  2013-01-28 21:54   ` Junio C Hamano
  0 siblings, 1 reply; 10+ messages in thread
From: Jonathan Nieder @ 2013-01-28 20:58 UTC (permalink / raw)
  To: Andrej Andb; +Cc: git, Giuseppe Bilotta, Jakub Narebski

(cc-ing some area experts)
Hi Andrej,

Andrej Andb wrote:

> [Subject: remove protocol from gravatar and picon links for clear if
> Gitweb is being called through a secure server]

Sounds good to me.  May we have your signoff?  (See
Documentation/SubmittingPatches for what this means.)

Thanks,
Jonathan
(patch left unsnipped for reference)

> ---
>  gitweb/gitweb.perl | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> index c6bafe6..1309196 100755
> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
> @@ -2068,7 +2068,7 @@ sub picon_url {
>  	if (!$avatar_cache{$email}) {
>  		my ($user, $domain) = split('@', $email);
>  		$avatar_cache{$email} =
> -			"http://www.cs.indiana.edu/cgi-pub/kinzler/piconsearch.cgi/" .
> +			"//www.cs.indiana.edu/cgi-pub/kinzler/piconsearch.cgi/" .
>  			"$domain/$user/" .
>  			"users+domains+unknown/up/single";
>  	}
> @@ -2083,7 +2083,7 @@ sub gravatar_url {
>  	my $email = lc shift;
>  	my $size = shift;
>  	$avatar_cache{$email} ||=
> -		"http://www.gravatar.com/avatar/" .
> +		"//www.gravatar.com/avatar/" .
>  			Digest::MD5::md5_hex($email) . "?s=";
>  	return $avatar_cache{$email} . $size;
>  }

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] remove protocol from gravatar and picon links for clear if Gitweb is being called through a secure server
  2013-01-28 20:58 ` Jonathan Nieder
@ 2013-01-28 21:54   ` Junio C Hamano
  2013-01-28 21:58     ` Junio C Hamano
  2013-01-28 22:10     ` Jonathan Nieder
  0 siblings, 2 replies; 10+ messages in thread
From: Junio C Hamano @ 2013-01-28 21:54 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: Andrej Andb, git, Giuseppe Bilotta, Jakub Narebski

Jonathan Nieder <jrnieder@gmail.com> writes:

> (cc-ing some area experts)
> Hi Andrej,
>
> Andrej Andb wrote:
>
>> [Subject: remove protocol from gravatar and picon links for clear if
>> Gitweb is being called through a secure server]
>
> Sounds good to me.  May we have your signoff?  (See
> Documentation/SubmittingPatches for what this means.)
>
> Thanks,
> Jonathan
> (patch left unsnipped for reference)
>
>> ---
>>  gitweb/gitweb.perl | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>> 
>> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
>> index c6bafe6..1309196 100755
>> --- a/gitweb/gitweb.perl
>> +++ b/gitweb/gitweb.perl
>> @@ -2068,7 +2068,7 @@ sub picon_url {
>>  	if (!$avatar_cache{$email}) {
>>  		my ($user, $domain) = split('@', $email);
>>  		$avatar_cache{$email} =
>> -			"http://www.cs.indiana.edu/cgi-pub/kinzler/piconsearch.cgi/" .
>> +			"//www.cs.indiana.edu/cgi-pub/kinzler/piconsearch.cgi/" .

Hrmph.  Is that even a valid URL to refer to that external site from
a https://my.site/some/where/ base URL?  I wouldn't be surprised if
browsers allowed it, but I do not recall seeing such a use in RFCs.

Intuitively it feels strange that the above lets the site that gave
you the base URL dictate over what scheme sites unrelated to it has
to serve their resources.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] remove protocol from gravatar and picon links for clear if Gitweb is being called through a secure server
  2013-01-28 21:54   ` Junio C Hamano
@ 2013-01-28 21:58     ` Junio C Hamano
  2013-01-28 22:10     ` Jonathan Nieder
  1 sibling, 0 replies; 10+ messages in thread
From: Junio C Hamano @ 2013-01-28 21:58 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: Andrej Andb, git, Giuseppe Bilotta, Jakub Narebski

Junio C Hamano <gitster@pobox.com> writes:

>>> -			"http://www.cs.indiana.edu/cgi-pub/kinzler/piconsearch.cgi/" .
>>> +			"//www.cs.indiana.edu/cgi-pub/kinzler/piconsearch.cgi/" .
>
> Hrmph.  Is that even a valid URL to refer to that external site from
> a https://my.site/some/where/ base URL?  I wouldn't be surprised if
> browsers allowed it, but I do not recall seeing such a use in RFCs.

ah, nevermind.  That's net_path in 1808.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] remove protocol from gravatar and picon links for clear if Gitweb is being called through a secure server
  2013-01-28 21:54   ` Junio C Hamano
  2013-01-28 21:58     ` Junio C Hamano
@ 2013-01-28 22:10     ` Jonathan Nieder
  2013-01-28 22:29       ` Junio C Hamano
  1 sibling, 1 reply; 10+ messages in thread
From: Jonathan Nieder @ 2013-01-28 22:10 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Andrej Andb, git, Giuseppe Bilotta, Jakub Narebski

Junio C Hamano wrote:
>> Andrej Andb wrote:

>>> --- a/gitweb/gitweb.perl
>>> +++ b/gitweb/gitweb.perl
>>> @@ -2068,7 +2068,7 @@ sub picon_url {
>>>  	if (!$avatar_cache{$email}) {
>>>  		my ($user, $domain) = split('@', $email);
>>>  		$avatar_cache{$email} =
>>> -			"http://www.cs.indiana.edu/cgi-pub/kinzler/piconsearch.cgi/" .
>>> +			"//www.cs.indiana.edu/cgi-pub/kinzler/piconsearch.cgi/" .
[...]
> Intuitively it feels strange that the above lets the site that gave
> you the base URL dictate over what scheme sites unrelated to it has
> to serve their resources.

The main effect is to slightly improve privacy.  A man in the middle
can still see the size of avatars and when you fetched them, but at
least this way when you are using HTTPS they do not see the names of
authors of commits you are looking at.

It also avoids a mixed content warning.

On the other hand, it hurts caching by proxies.

Jonathan

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] remove protocol from gravatar and picon links for clear if Gitweb is being called through a secure server
  2013-01-28 22:10     ` Jonathan Nieder
@ 2013-01-28 22:29       ` Junio C Hamano
  2013-01-28 22:33         ` Андрей Баранов
  2013-01-28 22:39         ` Jonathan Nieder
  0 siblings, 2 replies; 10+ messages in thread
From: Junio C Hamano @ 2013-01-28 22:29 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: Andrej Andb, git, Giuseppe Bilotta, Jakub Narebski

Jonathan Nieder <jrnieder@gmail.com> writes:

> Junio C Hamano wrote:
>>> Andrej Andb wrote:
>
>>>> --- a/gitweb/gitweb.perl
>>>> +++ b/gitweb/gitweb.perl
>>>> @@ -2068,7 +2068,7 @@ sub picon_url {
>>>>  	if (!$avatar_cache{$email}) {
>>>>  		my ($user, $domain) = split('@', $email);
>>>>  		$avatar_cache{$email} =
>>>> -			"http://www.cs.indiana.edu/cgi-pub/kinzler/piconsearch.cgi/" .
>>>> +			"//www.cs.indiana.edu/cgi-pub/kinzler/piconsearch.cgi/" .
> [...]
>> Intuitively it feels strange that the above lets the site that gave
>> you the base URL dictate over what scheme sites unrelated to it has
>> to serve their resources.
>
> The main effect is to slightly improve privacy.  A man in the middle
> can still see the size of avatars and when you fetched them, but at
> least this way when you are using HTTPS they do not see the names of
> authors of commits you are looking at.
>
> It also avoids a mixed content warning.
>
> On the other hand, it hurts caching by proxies.

I am sure mixed content warning was the primary motivation of the
patch.  Do we know these external sites actually server what we want
over https://?

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] remove protocol from gravatar and picon links for clear if Gitweb is being called through a secure server
  2013-01-28 22:29       ` Junio C Hamano
@ 2013-01-28 22:33         ` Андрей Баранов
  2013-01-28 23:08           ` Junio C Hamano
  2013-01-28 22:39         ` Jonathan Nieder
  1 sibling, 1 reply; 10+ messages in thread
From: Андрей Баранов @ 2013-01-28 22:33 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Jonathan Nieder, git, Giuseppe Bilotta, Jakub Narebski

Or maybe option like:
/etc/gitweb.conf:
$feature{'ssl'}{'default'} = ['allways']; ['auto']; ['none'];

but it's hard for me :) i don't know perl

2013/1/29 Junio C Hamano <gitster@pobox.com>:
> Jonathan Nieder <jrnieder@gmail.com> writes:
>
>> Junio C Hamano wrote:
>>>> Andrej Andb wrote:
>>
>>>>> --- a/gitweb/gitweb.perl
>>>>> +++ b/gitweb/gitweb.perl
>>>>> @@ -2068,7 +2068,7 @@ sub picon_url {
>>>>>    if (!$avatar_cache{$email}) {
>>>>>            my ($user, $domain) = split('@', $email);
>>>>>            $avatar_cache{$email} =
>>>>> -                  "http://www.cs.indiana.edu/cgi-pub/kinzler/piconsearch.cgi/" .
>>>>> +                  "//www.cs.indiana.edu/cgi-pub/kinzler/piconsearch.cgi/" .
>> [...]
>>> Intuitively it feels strange that the above lets the site that gave
>>> you the base URL dictate over what scheme sites unrelated to it has
>>> to serve their resources.
>>
>> The main effect is to slightly improve privacy.  A man in the middle
>> can still see the size of avatars and when you fetched them, but at
>> least this way when you are using HTTPS they do not see the names of
>> authors of commits you are looking at.
>>
>> It also avoids a mixed content warning.
>>
>> On the other hand, it hurts caching by proxies.
>
> I am sure mixed content warning was the primary motivation of the
> patch.  Do we know these external sites actually server what we want
> over https://?
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] remove protocol from gravatar and picon links for clear if Gitweb is being called through a secure server
  2013-01-28 22:29       ` Junio C Hamano
  2013-01-28 22:33         ` Андрей Баранов
@ 2013-01-28 22:39         ` Jonathan Nieder
  1 sibling, 0 replies; 10+ messages in thread
From: Jonathan Nieder @ 2013-01-28 22:39 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Andrej Andb, git, Giuseppe Bilotta, Jakub Narebski

Junio C Hamano wrote:

> I am sure mixed content warning was the primary motivation of the
> patch.

Sure, but that's not enough motivation for me to like it. ;-)
The privacy aspect is enough to motivate it for me.

>         Do we know these external sites actually server what we want
> over https://?

Yep.  cs.indiana.edu/cgi-pub/kinzler/piconsearch.cgi and
www.gravatar.com/avatar both support https and return the expected
responses for queries over https.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] remove protocol from gravatar and picon links for clear if Gitweb is being called through a secure server
  2013-01-28 22:33         ` Андрей Баранов
@ 2013-01-28 23:08           ` Junio C Hamano
  2013-01-28 23:43             ` Андрей Баранов
  0 siblings, 1 reply; 10+ messages in thread
From: Junio C Hamano @ 2013-01-28 23:08 UTC (permalink / raw)
  To: Андрей Баранов
  Cc: Jonathan Nieder, git, Giuseppe Bilotta, Jakub Narebski

Андрей Баранов  <admin@andrej-andb.ru> writes:

> Or maybe option like:
> /etc/gitweb.conf:
> $feature{'ssl'}{'default'} = ['allways']; ['auto']; ['none'];
>
> but it's hard for me :) i don't know perl

The effect is the same and your original patch is shorter and
cleaner to see what is going on; as far as the patch text is
concerned, the original one is just fine.

Except that we wanted a bit more stuff before "---" line.  How about
something like this?

        Subject: [PATCH] gitweb: refer to picon/gravatar images over the same scheme

        The images from picon and gravatar are always used over
        http://, and browsers give mixed contents warning when
        gitweb is served over https://.

        Just drop the scheme: part from the URL, so that these
        external sites are accessed over https:// in such a case.

        Signed-off-by: Your Name <your@addre.ss>
        ---
         gitweb/gitweb.perl | 4 ++--
         1 file changed, 2 insertions(+), 2 deletions(-)

        diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
	...

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] remove protocol from gravatar and picon links for clear if Gitweb is being called through a secure server
  2013-01-28 23:08           ` Junio C Hamano
@ 2013-01-28 23:43             ` Андрей Баранов
  0 siblings, 0 replies; 10+ messages in thread
From: Андрей Баранов @ 2013-01-28 23:43 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Jonathan Nieder, git, Giuseppe Bilotta, Jakub Narebski

re sended. Very big thanks for example :D

2013/1/29 Junio C Hamano <gitster@pobox.com>:
> Андрей Баранов  <admin@andrej-andb.ru> writes:
>
>> Or maybe option like:
>> /etc/gitweb.conf:
>> $feature{'ssl'}{'default'} = ['allways']; ['auto']; ['none'];
>>
>> but it's hard for me :) i don't know perl
>
> The effect is the same and your original patch is shorter and
> cleaner to see what is going on; as far as the patch text is
> concerned, the original one is just fine.
>
> Except that we wanted a bit more stuff before "---" line.  How about
> something like this?
>
>         Subject: [PATCH] gitweb: refer to picon/gravatar images over the same scheme
>
>         The images from picon and gravatar are always used over
>         http://, and browsers give mixed contents warning when
>         gitweb is served over https://.
>
>         Just drop the scheme: part from the URL, so that these
>         external sites are accessed over https:// in such a case.
>
>         Signed-off-by: Your Name <your@addre.ss>
>         ---
>          gitweb/gitweb.perl | 4 ++--
>          1 file changed, 2 insertions(+), 2 deletions(-)
>
>         diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
>         ...
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-01-28 23:44 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-28 19:14 [PATCH] remove protocol from gravatar and picon links for clear if Gitweb is being called through a secure server Andrej Andb
2013-01-28 20:58 ` Jonathan Nieder
2013-01-28 21:54   ` Junio C Hamano
2013-01-28 21:58     ` Junio C Hamano
2013-01-28 22:10     ` Jonathan Nieder
2013-01-28 22:29       ` Junio C Hamano
2013-01-28 22:33         ` Андрей Баранов
2013-01-28 23:08           ` Junio C Hamano
2013-01-28 23:43             ` Андрей Баранов
2013-01-28 22:39         ` Jonathan Nieder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).