Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

Commit

Permalink
Merge pull request #27 from guardian/sh-relax-content-type-check
Browse files Browse the repository at this point in the history
Relax the content type check
  • Loading branch information
sihil committed Sep 10, 2014
2 parents c879884 + a378c13 commit 1dead04
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -3,6 +3,7 @@ package com.gu.management.internal
import io.Source
import com.gu.management._
import com.sun.net.httpserver.{ HttpServer, HttpsServer, HttpExchange }
import scala.collection.JavaConversions._

object `package` extends FormParameterParsing {
implicit def integer2In(integer: Int) = new {
Expand All @@ -25,7 +26,7 @@ object `package` extends FormParameterParsing {

lazy val getPostParameters: ListMultiMap[String, String] = {
if (!(exchange.getRequestMethod equalsIgnoreCase "POST") ||
!(exchange.getRequestHeaders.get("Content-Type").contains("application/x-www-form-urlencoded"))) {
!exchange.getRequestHeaders.get("Content-Type").exists(_.contains("application/x-www-form-urlencoded"))) {
Map.empty[String, List[String]]
} else {
val postQueryString = Source.fromInputStream(exchange.getRequestBody, "UTF-8").mkString("")
Expand Down

0 comments on commit 1dead04

Please sign in to comment.