mirror of
https://github.com/curl/curl.git
synced 2026-08-04 23:56:13 +03:00
server/getpart: make the "XML-parser" stricter
When extracting a <section> <part> and there's no </part> before </section>, this now outputs an error and returns a wrong string to make users spot the mistake. Ref: #5070 Closes #5071
This commit is contained in:
parent
a7e24c7362
commit
fe8ba51209
3 changed files with 21 additions and 12 deletions
|
|
@ -1,12 +1,12 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
# Copyright (C) 2017 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
|
|
@ -30,7 +30,7 @@ import logging
|
|||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
REPLY_DATA = re.compile("<reply>\s*<data>(.*?)</data>", re.MULTILINE | re.DOTALL)
|
||||
REPLY_DATA = re.compile("<reply>[ \t\n\r]*<data[^<]*>(.*?)</data>", re.MULTILINE | re.DOTALL)
|
||||
|
||||
|
||||
class TestData(object):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue