title: Not getting the proper base url using requestUri on server machine using spark-submit
body: <p>My requirement is creating the rest json from the request uri using spray. I am using <code>requestUri</code> directive to get the base URL. When I run it through IDE or through spark-submit locally on my system, I got the proper output. But when I have done <code>spark-submit</code> on the cluster, I am not getting the base url using <code>requestUri</code> directive.The url, I am getting is partial. Because of which the expected output is also not proper.</p>
  
  <p>The code to get the url is </p>
  
  <pre><code>requestUri {
        uri =&gt;
        val reqUri = s"$uri"//uri.toString()
          complete {
          println ("URI " + reqUri)
      }
  }
  </code></pre>
  
  <p>build.sbt looks like this</p>
  
  <pre><code>scalaVersion := "2.10.5"
  
  libraryDependencies += "org.apache.spark" %% "spark-core" % "1.4.0"
  
  resolvers ++= Seq(
    "Akka Repository" at "http://repo.akka.io/releases/")
  
  resolvers ++= Seq("Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/",
    "Spray Repository"    at "http://repo.spray.io")
  
  
  libraryDependencies +=
    "com.typesafe.akka" %% "akka-actor" % "2.3.0"
  
  
  libraryDependencies ++= {
    val sprayVersion      = "1.3.1"
    Seq(
      "io.spray"          %% "spray-can"       % sprayVersion,
      "io.spray"          %% "spray-routing"   % sprayVersion,
      "io.spray"          %% "spray-json"      % sprayVersion
  
    )
  }
  </code></pre>
  
  <p>Please let me know how I can I fix this issue.All your suggestions are valuable. Thanks in advance.</p>