mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
fix bug with leading dot in cookie domains
This commit is contained in:
parent
5f1b029f42
commit
a55c6be5cf
@ -125,11 +125,14 @@ parse_set_cookie(const string &format, const URLSpec &url) {
|
||||
////////////////////////////////////////////////////////////////////
|
||||
bool HTTPCookie::
|
||||
matches_url(const URLSpec &url) const {
|
||||
if (_domain.empty()) {
|
||||
return false;
|
||||
}
|
||||
string server = url.get_server();
|
||||
if (server == _domain ||
|
||||
(server.length() > _domain.length() &&
|
||||
server.substr(server.length() - _domain.length()) == _domain &&
|
||||
server[server.length() - _domain.length() - 1] == '.')) {
|
||||
(_domain[0] == '.' || server[server.length() - _domain.length() - 1] == '.'))) {
|
||||
// The domain matches.
|
||||
|
||||
string path = url.get_path();
|
||||
|
Loading…
x
Reference in New Issue
Block a user