Bugs item #2002866, was opened at 2008-06-25 21:11
Message generated for change (Comment added) made by mwoodiupui
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=119984&aid=2002866&group_id=19984

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: XMLUI (Manakin)
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Conal Tuohy (conal_tuohy)
Assigned to: Nobody/Anonymous (nobody)
Summary: "Not found" page returns 200 OK instead of 404 Not Found

Initial Comment:
The Manakin "not found" page does not set the HTTP Response header to 404. e.g. 
as at 2008-06-26 the following URLs all returned 200 OK:

http://researcharchive.vuw.ac.nz/blah
http://repositories.tamu.edu/blah
https://oa.doria.fi/blah 

This is a problem for automated system monitoring, log analysis, etc.

----------------------------------------------------------------------

>Comment By: Mark H. Wood (mwoodiupui)
Date: 2009-01-21 15:54

Message:
Committed revision 3387.


----------------------------------------------------------------------

Comment By: Mark H. Wood (mwoodiupui)
Date: 2008-06-26 07:41

Message:
Logged In: YES 
user_id=576574
Originator: NO

I fixed it this way in DSpace 1.4.2/Manakin 1.1a:

Index: manakin/src/org/dspace/app/xmlui/PageNotFoundTransformer.java
===================================================================
--- manakin/src/org/dspace/app/xmlui/PageNotFoundTransformer.java      
(revision 173)
+++ manakin/src/org/dspace/app/xmlui/PageNotFoundTransformer.java      
(revision 184)
@@ -44,9 +44,12 @@
 import java.io.Serializable;
 import java.sql.SQLException;
 
+import javax.servlet.http.HttpServletResponse;
+
 import org.apache.cocoon.caching.CacheableProcessingComponent;
 import org.apache.cocoon.environment.ObjectModelHelper;
 import org.apache.cocoon.environment.Request;
+import org.apache.cocoon.environment.http.HttpEnvironment;
 import org.apache.cocoon.util.HashUtil;
 import org.apache.excalibur.source.SourceValidity;
 import org.apache.excalibur.source.impl.validity.NOPValidity;
@@ -197,6 +200,10 @@
             notFound.addPara(T_para1); 
             
             notFound.addPara().addXref(contextPath,T_go_home);
+
+           HttpServletResponse response = (HttpServletResponse)
objectModel
+                .get(HttpEnvironment.HTTP_RESPONSE_OBJECT);
+           response.setStatus(HttpServletResponse.SC_NOT_FOUND);
         }
     }


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=119984&aid=2002866&group_id=19984

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Dspace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-devel

Reply via email to