title: Serving files with Echo
body: <p>I'm trying to serve multiple files with Echo, but it doesn't work every time.
  The api code looks like this:</p>
  
  <pre><code>package main
  
  import (
      "github.com/labstack/echo"
  
      "net/http"
  )
  
  func main() {
      e := echo.New();
  
      e.GET("/", home);
  
      e.File("/data1", "assets/data1.csv");
  
      e.File("/data2", "assets/data2.csv");
  
      e.Logger.Fatal(e.Start(":4243"));
  }
  
  func home(c echo.Context) error {
    return c.String(http.StatusOK, "Are you lost?");
  }
  </code></pre>
  
  <p>To be precise, it does work for the very first file fetching, but then keeps failing for any subsequent calls (be them file fetching or more "classic" calls). The error message is a tad different for each browser:</p>
  
  <p>In Chrome:</p>
  
  <blockquote>
    <p>SyntaxError: Failed to execute 'setRequestHeader' on 'XMLHttpRequest': 'Bearer {the_entire_content_of_the_first_fetched_file}' is not a valid HTTP header field value.</p>
  </blockquote>
  
  <p>In Firefox:</p>
  
  <blockquote>
    <p>SyntaxError: An invalid or illegal string was specified</p>
  </blockquote>
  
  <p>In Edge, simply:</p>
  
  <blockquote>
    <p>SyntaxError</p>
  </blockquote>
  
  <p>Tried activating CORS, nothing changed.</p>
  
  <p>Looks to work pretty well with Postman. Maybe it's a problem with how I do fetch my data in my application?</p>
  
  <p>If you need perhaps a bit more information, this thread is directly related to my previous one (<a href="https://stackoverflow.com/questions/45543099/vuejs-with-axios-request-in-vuex-store-cant-make-more-than-one-request-why">Vuejs with axios request in vuex store: can&#39;t make more than one request, why?</a>), but I didn't want to mix them up, as I don't know yet if I'm mistaken in my Vue code or my Echo one...</p>