mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	avatars: Clean up now-irrelevant assumptions.
This x=x hack was removed in 3bd3173b1f.
			
			
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							fb929ca218
						
					
				
				
					commit
					41d1b417e7
				
			@@ -285,9 +285,10 @@ def serve_local_avatar_unauthed(request: HttpRequest, path: str) -> HttpResponse
 | 
			
		||||
        # We do not expect clients to hit this URL when using the S3
 | 
			
		||||
        # backend; however, there is no reason to not serve the
 | 
			
		||||
        # redirect to S3 where the content lives.
 | 
			
		||||
        return redirect(
 | 
			
		||||
            get_public_upload_root_url() + path + "?" + request.GET.urlencode(), permanent=True
 | 
			
		||||
        )
 | 
			
		||||
        url = get_public_upload_root_url() + path
 | 
			
		||||
        if request.GET.urlencode():
 | 
			
		||||
            url += "?" + request.GET.urlencode()
 | 
			
		||||
        return redirect(url, permanent=True)
 | 
			
		||||
 | 
			
		||||
    local_path = os.path.join(settings.LOCAL_AVATARS_DIR, path)
 | 
			
		||||
    assert_is_local_storage_path("avatars", local_path)
 | 
			
		||||
 
 | 
			
		||||
@@ -312,11 +312,8 @@ def avatar(
 | 
			
		||||
        avatar_version = 1
 | 
			
		||||
        url = get_gravatar_url(email, avatar_version, medium)
 | 
			
		||||
 | 
			
		||||
    # We can rely on the URL already having query parameters. Because
 | 
			
		||||
    # our templates depend on being able to use the ampersand to
 | 
			
		||||
    # add query parameters to our url, get_avatar_url does '?x=x'
 | 
			
		||||
    # hacks to prevent us from having to jump through decode/encode hoops.
 | 
			
		||||
    assert url is not None
 | 
			
		||||
    if request.META["QUERY_STRING"]:
 | 
			
		||||
        url = append_url_query_string(url, request.META["QUERY_STRING"])
 | 
			
		||||
    return redirect(url)
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user