Polylines displayed beneath ground level when terrain provider is set

1. A concise explanation of the problem you're experiencing.

Adding a polyline to the map works when no terrain provider is defined. The shape is then buried beneath ground level when adding a terrain provider.
I would like to clamp the polyline to the ground level.

2. A minimal code example. If you've found a bug, this helps us reproduce and repair it.

<!DOCTYPE html>
<html lang="en">
<head>
    <base href="https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/gallery/">
    <title>Cesium Demo</title>
    <script type="text/javascript" src="../../../CesiumUnminified/Cesium.js"></script>
    
</head>
<body>
<style>
    @import url(../templates/bucket.css);
</style>
<div id="cesiumContainer" class="fullSize"></div>
<script id="cesium_sandcastle_script">

  function startup(Cesium) {
    'use strict';
    var viewer = new Cesium.Viewer('cesiumContainer', {
      terrainProvider : Cesium.createWorldTerrain(),
    });
    
    viewer.scene.globe.depthTestAgainstTerrain = true;
  
    var redLine = viewer.entities.add({
      name : 'Red line on the surface',
      polyline : {
        positions : Cesium.Cartesian3.fromDegreesArray(
          [
            5.717999,45.180306,
            5.718722,45.180353,
            5.71879,45.180348,
            5.719401,45.180386,
            5.719543,45.180384,
            5.719679,45.180386,
            5.719834,45.180428,
            5.719941,45.180437,
            5.720066,45.180445,
            5.720916,45.180496,
            5.721048,45.180506,
            5.721155,45.180514,
            5.721429,45.180537,
            5.721944,45.18058,
            5.722014,45.180579,
            5.722192,45.180598,
            5.722411,45.180624,
            5.722595,45.180645,
            5.722701,45.180657,
            5.722982,45.180705,
            5.723298,45.180762,
            5.723468,45.180792,
            5.723755,45.180846,
            5.724686,45.181038,
            5.724789,45.181134,
            5.724958,45.181168,
            5.725183,45.181218,
            5.725661,45.181323,
            5.726021,45.181422,
            5.726587,45.18158,
            5.726844,45.181659,
            5.727266,45.181787,
            5.727294,45.181795,
            5.727506,45.181872,
            5.727608,45.181888,
            5.727703,45.18193,
            5.727843,45.18204,
            5.728544,45.182421,
            5.728573,45.182434,
            5.728693,45.182485,
            5.728925,45.182504,
            5.729653,45.182815,
            5.729995,45.182961,
            5.730373,45.183116,
            5.730456,45.183149,
            5.730543,45.183186,
            5.730957,45.183359,
            5.731313,45.183498,
            5.731375,45.183511,
            5.731433,45.18353,
            5.7315,45.183557,
            5.7315,45.183557,
            5.7315,45.183557,
            5.7315,45.183557,
            5.731536,45.183572,
            5.731595,45.183595,
            5.731641,45.183612,
            5.731683,45.183629,
            5.731755,45.183599,
            5.731814,45.183539,
            5.731962,45.183511,
            5.732586,45.183397,
            5.732641,45.183387,
            5.732728,45.183375,
            5.733406,45.183278,
            5.733509,45.183251,
            5.733584,45.183093,
            5.733642,45.183015,
            5.733656,45.182993,
            5.733785,45.182837,
            5.734136,45.182122,
            5.734183,45.182123,
            5.734297,45.182123,
            5.734393,45.182115,
            5.73443,45.182025,
            5.734468,45.181931,
            5.734519,45.18188,
            5.734516,45.18182,
            5.734678,45.181501,
            5.734708,45.181424,
            5.734771,45.181261,
            5.735001,45.180774,
            5.735019,45.180747,
            5.735106,45.180623,
            5.735189,45.180623,
            5.735521,45.180623,
            5.735552,45.180623,
            5.737679,45.180622,
            5.737816,45.180612,
            5.73785,45.180612,
            5.738844,45.180595,
            5.738844,45.180595,
            5.738844,45.180595,
            5.73886,45.180595,
            5.738919,45.180596,
            5.738982,45.180596,
            5.73905,45.180595,
            5.739103,45.180594,
            5.73985,45.180578,
            5.740471,45.180567,
            5.740806,45.18057,
            5.741017,45.180571,
            5.741223,45.180579,
            5.741471,45.180584,
            5.741588,45.180584,
            5.74186,45.18014,
            5.742037,45.179828,
            5.742059,45.179788,
            5.74213,45.17963,
            5.742152,45.179577,
            5.742304,45.179203,
            5.74239,45.17898,
            5.742418,45.178909,
            5.742461,45.178805,
            5.742467,45.178789,
            5.742532,45.178626,
            5.742573,45.178507,
            5.742582,45.178483,
            5.742617,45.178381,
            5.742641,45.178311,
            5.742671,45.178225,
            5.742693,45.178168,
            5.742707,45.178132,
            5.742726,45.178089,
            5.742653,45.178073,
            5.742694,45.17796,
            5.742778,45.177731,
            5.74284,45.177567
          ]
        ),
        width : 5,
        material : Cesium.Color.GREEN,
        depthFailMaterial : Cesium.Color.RED,
        followSurface : true,
      }
    });
    viewer.zoomTo(viewer.entities);
  }
  if (typeof Cesium !== "undefined") {
    startup(Cesium);
  } else if (typeof require === "function") {
    require(["Cesium"], startup);
  }
</script>
</body>
</html>

3. Context. Why do you need to do this? We might know a better way to accomplish your goal.

I want to highlight a path from given coordinates. Said path should follow the ground elevations.
Normal material is set to Green, depthFailMaterial is set to Red so we can see the shape through the ground.

4. The Cesium version you're using, your operating system and browser.

Cesium 1.45, Mac OS 10.13.4, Safari 11.1.

Polylines on terrain are coming soon! We’re working on them now, see our progress in Issue #2172. As a workaround in the meantime, you can use corridors.

Thanks,

Gabby