From fea0c07e1cce7e85f41bc5dffbe239840a407c75 Mon Sep 17 00:00:00 2001 From: Dennis Luxen Date: Tue, 21 Jan 2014 16:31:29 +0100 Subject: [PATCH] implements #386 --- Server/APIGrammar.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Server/APIGrammar.h b/Server/APIGrammar.h index bca0b9e30..f377e6f10 100644 --- a/Server/APIGrammar.h +++ b/Server/APIGrammar.h @@ -42,7 +42,7 @@ struct APIGrammar : qi::grammar { zoom = (-qi::lit('&')) >> qi::lit('z') >> '=' >> qi::short_[boost::bind(&HandlerT::setZoomLevel, handler, ::_1)]; output = (-qi::lit('&')) >> qi::lit("output") >> '=' >> string[boost::bind(&HandlerT::setOutputFormat, handler, ::_1)]; - jsonp = (-qi::lit('&')) >> qi::lit("jsonp") >> '=' >> stringwithDot[boost::bind(&HandlerT::setJSONpParameter, handler, ::_1)]; + jsonp = (-qi::lit('&')) >> qi::lit("jsonp") >> '=' >> stringwithPercent[boost::bind(&HandlerT::setJSONpParameter, handler, ::_1)]; checksum = (-qi::lit('&')) >> qi::lit("checksum") >> '=' >> qi::int_[boost::bind(&HandlerT::setChecksum, handler, ::_1)]; instruction = (-qi::lit('&')) >> qi::lit("instructions") >> '=' >> qi::bool_[boost::bind(&HandlerT::setInstructionFlag, handler, ::_1)]; geometry = (-qi::lit('&')) >> qi::lit("geometry") >> '=' >> qi::bool_[boost::bind(&HandlerT::setGeometryFlag, handler, ::_1)]; @@ -53,16 +53,17 @@ struct APIGrammar : qi::grammar { alt_route = (-qi::lit('&')) >> qi::lit("alt") >> '=' >> qi::bool_[boost::bind(&HandlerT::setAlternateRouteFlag, handler, ::_1)]; old_API = (-qi::lit('&')) >> qi::lit("geomformat") >> '=' >> string[boost::bind(&HandlerT::setDeprecatedAPIFlag, handler, ::_1)]; - string = +(qi::char_("a-zA-Z")); - stringwithDot = +(qi::char_("a-zA-Z0-9_.-")); + string = +(qi::char_("a-zA-Z")); + stringwithDot = +(qi::char_("a-zA-Z0-9_.-")); + stringwithPercent = +(qi::char_("a-zA-Z0-9_.-") | qi::char_('[') | qi::char_(']') | (qi::char_('%') >> qi::char_("0-9A-Z") >> qi::char_("0-9A-Z") )); } + qi::rule api_call, query; qi::rule service, zoom, output, string, jsonp, checksum, location, hint, - stringwithDot, language, instruction, geometry, + stringwithDot, stringwithPercent, language, instruction, geometry, cmp, alt_route, old_API; HandlerT * handler; }; - #endif /* APIGRAMMAR_H_ */