mirror of
https://github.com/graygnuorg/pound.git
synced 2026-10-28 11:35:07 +03:00
Mandatory percent decoding creates more problems than it solves. It can perhaps be used optionally in request matching, but that is left for further consideration. * doc/pound.8: Document changes. * src/http.c: Don't urldecode request parts. (expand_string_to_buffer): Return -1 if invalid barckreferences or accessors are encountered. Don't bail out on percent-encodings. (expand_string): Handle error return from expand_string_to_buffer. * src/pound.h (http_request): Remove storage for decoded values. * tests/poundharness.pl (getline): Handle undefined return gratiously. (ParseRequest): Terminate thread on EOF. * tests/backref.at: Update expected values. * tests/experr.at: Likewise. * tests/lstset.at: Likewise. * tests/redirect.at: Likewise. * tests/reqacc.at: Likewise. * tests/set.at: Likewise.
99 lines
1.8 KiB
Plaintext
99 lines
1.8 KiB
Plaintext
# This file is part of pound testsuite. -*- autotest -*-
|
|
# Copyright (C) 2023 Sergey Poznyakoff
|
|
#
|
|
# Pound is free software; you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation; either version 3 of the License, or
|
|
# (at your option) any later version.
|
|
#
|
|
# Pound is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with pound. If not, see <http://www.gnu.org/licenses/>.
|
|
AT_SETUP([Multiple back references])
|
|
AT_KEYWORDS([backref rewrite reqacc accessor])
|
|
|
|
PT_CHECK([ListenHTTP
|
|
Service
|
|
Rewrite
|
|
Header "X-A: (.*)"
|
|
Header "X-B: (.*)"
|
|
Header "X-C: (.*)"
|
|
Header "X-D: (.*)"
|
|
Header "X-E: (.*)"
|
|
Header "X-F: (.*)"
|
|
Header "X-G: (.*)"
|
|
Header "X-H: (.*)"
|
|
Header "X-I: (.*)"
|
|
SetPath ["/echo/$1/$1(1)/$1(2)/$1(3)/$1(4)/$1(5)/$1(6)/$1(7)"]
|
|
End
|
|
Backend
|
|
Address
|
|
Port
|
|
End
|
|
End
|
|
End
|
|
],
|
|
[GET /foo
|
|
X-A: a
|
|
X-B: b
|
|
X-C: c
|
|
X-D: d
|
|
X-E: e
|
|
X-F: f
|
|
X-G: g
|
|
X-H: h
|
|
X-I: i
|
|
end
|
|
|
|
200
|
|
x-orig-uri: /echo/i/h/g/f/e/d/c/b
|
|
end
|
|
])
|
|
|
|
PT_CHECK([ListenHTTP
|
|
Service
|
|
Rewrite
|
|
Header "X-A: (.*)"
|
|
Header "X-B: (.*)"
|
|
Header "X-C: (.*)"
|
|
Header "X-D: (.*)"
|
|
Header "X-E: (.*)"
|
|
Header "X-F: (.*)"
|
|
Header "X-G: (.*)"
|
|
Header "X-H: (.*)"
|
|
Header "X-I: (.*)"
|
|
SetPath ["/echo/$1/$1(1)/$1(2)/$1(3)/$1(4)/$1(5)/$1(6)/$1(7)/$1(8)"]
|
|
End
|
|
Backend
|
|
Address
|
|
Port
|
|
End
|
|
End
|
|
End
|
|
],
|
|
[GET /foo
|
|
X-A: a
|
|
X-B: b
|
|
X-C: c
|
|
X-D: d
|
|
X-E: e
|
|
X-F: f
|
|
X-G: g
|
|
X-H: h
|
|
X-I: i
|
|
end
|
|
|
|
500
|
|
end
|
|
])
|
|
|
|
AT_CHECK([fgrep -q 'pound: path "/echo/$1/$1(1)/$1(2)/$1(3)/$1(4)/$1(5)/$1(6)/$1(7)/$1(8)" refers to non-existing group $1(8)' pound.log])
|
|
|
|
AT_CLEANUP
|
|
|
|
|