]> git.ipfire.org Git - thirdparty/squid.git/blame - src/acl/UrlLogin.cc
Use AnyP::Uri::Decode() for urllogin checks (#1659)
[thirdparty/squid.git] / src / acl / UrlLogin.cc
CommitLineData
9d35fe37 1/*
b8ae064d 2 * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
9d35fe37 3 *
bbc27441
AJ
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
9d35fe37
AJ
7 */
8
bbc27441
AJ
9/* DEBUG: section 28 Access Control */
10
b6f08f5c 11#include "squid.h"
4eac3407 12#include "acl/FilledChecklist.h"
602d9612 13#include "acl/UrlLogin.h"
226394f2 14#include "anyp/Uri.h"
9d35fe37 15#include "HttpRequest.h"
9d35fe37
AJ
16
17int
8319d478 18Acl::UrlLoginCheck::match(ACLChecklist * const ch)
9d35fe37 19{
8319d478
AR
20 const auto checklist = Filled(ch);
21
92d6986d
AJ
22 if (checklist->request->url.userInfo().isEmpty()) {
23 debugs(28, 5, "URL has no user-info details. cannot match");
24 return 0; // nothing can match
25 }
26
226394f2
FC
27 auto decodedUserInfo = AnyP::Uri::Decode(checklist->request->url.userInfo());
28 return data->match(decodedUserInfo.c_str());
9d35fe37
AJ
29}
30