Ticket #2237 (closed feature: fixed)

Opened 4 years ago

Last modified 4 years ago

make WFS protocol and format more robust

Reported by: elemoine Owned by:
Priority: minor Milestone: 2.9 Release
Component: Protocol.WFS Version: SVN
Keywords: Cc:
State: Complete

Description

I've recently come across the case where a WFS server sends back incomplete (truncated) GetFeature responses.

In Internet Explorer this results in a js error in the XML Format's readNode method, because the node argument passed to the readNode method is null.

In FireFox this results in a js error in the GML format (in the feature["*"] reader of the GML.Base format). The error occurs later than in IE because FireFox creates a parsererror XML document when it fails to parse the XML.

The js error can be reproduced, both in FF and IE, with the test_badxml test in test.patch Download.

Patch to follow.

Attachments

test.patch Download (2.6 KB) - added by elemoine 4 years ago.
FF.patch Download (0.5 KB) - added by elemoine 4 years ago.
IE.patch Download (486 bytes) - added by elemoine 4 years ago.

Change History

Changed 4 years ago by elemoine

Changed 4 years ago by elemoine

Changed 4 years ago by elemoine

  Changed 4 years ago by elemoine

  • owner elemoine deleted
  • state set to Review

IE.patch Download fixes it in Internet Explorer. FF.patch Download fixes it in FireFox.

Please review. I think test.patch Download need not be committed - t.plan(0) being a bit weird. I attached it just to make it easy to reproduce the error.

follow-up: ↓ 3   Changed 4 years ago by ahocevar

  • state changed from Review to Commit

Both FF.patch and IE.patch look safe to me. Not sure if they improve things in real life conditions, but since they don't do any harm, I'd say please commit.

I agree that test.patch is not needed.

in reply to: ↑ 2   Changed 4 years ago by elemoine

Replying to ahocevar:

Both FF.patch and IE.patch look safe to me. Not sure if they improve things in real life conditions,

they do. In a context where you don't control the WFS servers and where the WFS servers return bad XML, with this patch you don't end up with js errors making your app in an unpredictable state.

but since they don't do any harm, I'd say please commit. I agree that test.patch is not needed.

Thanks a lot for the review.

  Changed 4 years ago by elemoine

  • status changed from new to closed
  • state changed from Commit to Complete
  • resolution set to fixed

(In [9636]) make WFS protocol and format more robust, r=ahocevar (closes #2237)

Note: See TracTickets for help on using tickets.