Change HTTP response 303 to 302
This commit is contained in:
		@@ -563,7 +563,7 @@ class Application:
 | 
				
			|||||||
            if not environ.get("PATH_INFO"):
 | 
					            if not environ.get("PATH_INFO"):
 | 
				
			||||||
                web_path = posixpath.join(posixpath.basename(base_prefix),
 | 
					                web_path = posixpath.join(posixpath.basename(base_prefix),
 | 
				
			||||||
                                          web_path)
 | 
					                                          web_path)
 | 
				
			||||||
            return (client.SEE_OTHER,
 | 
					            return (client.FOUND,
 | 
				
			||||||
                    {"Location": web_path, "Content-Type": "text/plain"},
 | 
					                    {"Location": web_path, "Content-Type": "text/plain"},
 | 
				
			||||||
                    "Redirected to %s" % web_path)
 | 
					                    "Redirected to %s" % web_path)
 | 
				
			||||||
        # Dispatch .web URL to web module
 | 
					        # Dispatch .web URL to web module
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -40,16 +40,16 @@ class BaseRequestsMixIn:
 | 
				
			|||||||
    def test_root(self):
 | 
					    def test_root(self):
 | 
				
			||||||
        """GET request at "/"."""
 | 
					        """GET request at "/"."""
 | 
				
			||||||
        status, _, answer = self.request("GET", "/")
 | 
					        status, _, answer = self.request("GET", "/")
 | 
				
			||||||
        assert status == 303
 | 
					        assert status == 302
 | 
				
			||||||
        assert answer == "Redirected to .web"
 | 
					        assert answer == "Redirected to .web"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def test_script_name(self):
 | 
					    def test_script_name(self):
 | 
				
			||||||
        """GET request at "/" with SCRIPT_NAME."""
 | 
					        """GET request at "/" with SCRIPT_NAME."""
 | 
				
			||||||
        status, _, answer = self.request("GET", "/", SCRIPT_NAME="/radicale")
 | 
					        status, _, answer = self.request("GET", "/", SCRIPT_NAME="/radicale")
 | 
				
			||||||
        assert status == 303
 | 
					        assert status == 302
 | 
				
			||||||
        assert answer == "Redirected to .web"
 | 
					        assert answer == "Redirected to .web"
 | 
				
			||||||
        status, _, answer = self.request("GET", "", SCRIPT_NAME="/radicale")
 | 
					        status, _, answer = self.request("GET", "", SCRIPT_NAME="/radicale")
 | 
				
			||||||
        assert status == 303
 | 
					        assert status == 302
 | 
				
			||||||
        assert answer == "Redirected to radicale/.web"
 | 
					        assert answer == "Redirected to radicale/.web"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def test_add_event(self):
 | 
					    def test_add_event(self):
 | 
				
			||||||
@@ -312,7 +312,7 @@ class BaseRequestsMixIn:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    def test_head(self):
 | 
					    def test_head(self):
 | 
				
			||||||
        status, _, _ = self.request("HEAD", "/")
 | 
					        status, _, _ = self.request("HEAD", "/")
 | 
				
			||||||
        assert status == 303
 | 
					        assert status == 302
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def test_options(self):
 | 
					    def test_options(self):
 | 
				
			||||||
        status, headers, _ = self.request("OPTIONS", "/")
 | 
					        status, headers, _ = self.request("OPTIONS", "/")
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -104,7 +104,7 @@ class Web(BaseWeb):
 | 
				
			|||||||
            return NOT_FOUND
 | 
					            return NOT_FOUND
 | 
				
			||||||
        if os.path.isdir(filesystem_path) and not path.endswith("/"):
 | 
					        if os.path.isdir(filesystem_path) and not path.endswith("/"):
 | 
				
			||||||
            location = posixpath.basename(path) + "/"
 | 
					            location = posixpath.basename(path) + "/"
 | 
				
			||||||
            return (client.SEE_OTHER,
 | 
					            return (client.FOUND,
 | 
				
			||||||
                    {"Location": location, "Content-Type": "text/plain"},
 | 
					                    {"Location": location, "Content-Type": "text/plain"},
 | 
				
			||||||
                    "Redirected to %s" % location)
 | 
					                    "Redirected to %s" % location)
 | 
				
			||||||
        if os.path.isdir(filesystem_path):
 | 
					        if os.path.isdir(filesystem_path):
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user