- From: Thomas Gambet via cvs-syncmail <cvsmail@w3.org>
- Date: Wed, 07 Oct 2009 12:48:21 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/2006/unicorn/src/org/w3c/unicorn/action In directory hutz:/tmp/cvs-serv29490/src/org/w3c/unicorn/action Modified Files: ObserveAction.java Log Message: added the possibility to check the referer Index: ObserveAction.java =================================================================== RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/action/ObserveAction.java,v retrieving revision 1.49 retrieving revision 1.50 diff -u -d -r1.49 -r1.50 --- ObserveAction.java 6 Oct 2009 08:16:02 -0000 1.49 +++ ObserveAction.java 7 Oct 2009 12:48:18 -0000 1.50 @@ -165,8 +165,14 @@ logger.trace("Output parameter: " + key + " - " + (String) reqParams.get(key)); mapOfOutputParameter.put(paramName, (String) reqParams.get(key)); } else if (paramName.equals("uri")) { - logger.trace("Uri parameter: " + key + " - " + (String) reqParams.get(key)); - aUnicornCall.setInputParameter(new URIInputParameter((String) reqParams.get(key))); + String uriParam = (String) reqParams.get(key); + if (uriParam.equals("referer")) { + uriParam = req.getHeader("Referer"); + if (uriParam == null) + messages.add(new Message(Message.ERROR, "$message_no_referer")); + } + logger.trace("Uri parameter: " + key + " - " + uriParam); + aUnicornCall.setInputParameter(new URIInputParameter(uriParam)); } else if (paramName.equals("text")) { logger.trace("Text parameter: " + key + " - " + (String) reqParams.get(key)); aUnicornCall.setInputParameter(new DirectInputParameter((String) reqParams.get(key), (String) reqParams.get(paramPrefix + "text_mime")));
Received on Wednesday, 7 October 2009 12:48:22 UTC