1

MapServer adds a XML-comment right before the <Service> tag in a GetCapabilities repsonse like this:

<!-- MapServer version 7.4.2 OUTPUT=PNG OUTPUT=JPEG [...] -->

Is it possible to remove this comment somehow?

3
  • As far as I know it is not possible without rewriting XML with some external utility. Write mail to MapServer-users list and ask if you do not get any better answer from here.
    – user30184
    Mar 11 '20 at 10:40
  • It appears in the SOS and WMS outputs but not WFS or WCS
    – nmtoken
    Mar 11 '20 at 12:14
  • Yes, forgot to mention that this is a WMS GetCapabilities response. Didn't test it with WFS yet.
    – baal
    Mar 12 '20 at 8:55
3

It's not possible using out of the box MapServer. However, you can use MapScript (MapServer's scripting capabilitiy) to intercept the response and remove the comment as needed.

3
  • Thank you for the answer. This is nevertheless disappointing as this should be configurable. The MapServer comment is not useful in any way in a production environment and only adds unwanted data and traffic.
    – baal
    Mar 12 '20 at 8:59
  • @baal I find it useful, both to know what service versions we're running, and also to know what versions others are using as part of a help desk function I involved in
    – nmtoken
    Mar 12 '20 at 12:21
  • Echoing @nmtoken for debugging usefulness. Having said this, feel free to open an issue or bring this up on the MapServer users mailing list. Mar 13 '20 at 10:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.