on master help sign in
Clarify documentation on rawPathInfo #325
commitc3413497b87f14ca34701c93d69698c8dad2ca21 authorMichael Snoyman <michael@snoyman.com> dateThu 15 Jan 2015, 08:43 (12 years ago) parent3d99b58
3 files changed+17−3
wai/ChangeLog.md+4−1 wai/Network/Wai/Internal.hs+12−1 wai/wai.cabal+1−1
wai/ChangeLog.md+4−1
@@ -1 +1,4 @@
1−No changes logged yet.
1+## 3.0.2.2
2+
3+* Clarify some documentation on `rawPathInfo`. [Relevant Github
4+ discussion](https://github.com/yesodweb/wai/issues/325#issuecomment-69896780).
wai/Network/Wai/Internal.hs+12−1
@@ -28,7 +28,18 @@ data Request = Request {
2828 -- depending on backend; in a standalone server setting, this is most likely
2929 -- all information after the domain name. In a CGI application, this would be
3030 -- the information following the path to the CGI executable itself.
31− -- Do not modify this raw value- modify pathInfo instead.
31+ --
32+ -- Middlewares and routing tools should not modify this raw value, as it may
33+ -- be used for such things as creating redirect destinations by applications.
34+ -- Instead, if you are writing a middleware or routing framework, modify the
35+ -- @pathInfo@ instead. This is the approach taken by systems like Yesod
36+ -- subsites.
37+ --
38+ -- /Note/: At the time of writing this documentation, there is at least one
39+ -- system (@Network.Wai.UrlMap@ from @wai-extra@) that does not follow the
40+ -- above recommendation. Therefore, it is recommended that you test the
41+ -- behavior of your application when using @rawPathInfo@ and any form of
42+ -- library that might modify the @Request@.
3243 , rawPathInfo :: B.ByteString
3344 -- | If no query string was specified, this should be empty. This value
3445 -- /will/ include the leading question mark.
wai/wai.cabal+1−1
@@ -1,5 +1,5 @@
11Name: wai
2−Version: 3.0.2.1
2+Version: 3.0.2.2
33Synopsis: Web Application Interface.
44Description: Provides a common protocol for communication between web applications and web servers.
55description: API docs and the README are available at <http://www.stackage.org/package/wai>.