Skip to content

Commit 97558fd

Browse files
Chandrashekhar KoriviChandrashekhar Korivi
authored andcommitted
Merge branch 'MTDSA-1244'
2 parents 210a3fb + 62a399a commit 97558fd

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

app/uk/gov/hmrc/vatapi/config/microserviceGlobal.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ object MicroserviceGlobal
189189
private def enabledFilters: Seq[EssentialFilter] = Seq.empty
190190

191191
override def microserviceFilters: Seq[EssentialFilter] =
192-
Seq(HeaderValidatorFilter, EmptyResponseFilter, SetContentTypeFilter, SetXContentTypeOptionsFilter) ++ enabledFilters ++
192+
Seq(SetXContentTypeOptionsFilter, HeaderValidatorFilter, EmptyResponseFilter, SetContentTypeFilter) ++ enabledFilters ++
193193
defaultMicroserviceFilters
194194

195195
override def onStart(app: Application): Unit = {

func/uk/gov/hmrc/vatapi/resources/SetXContentTypeOptionsFilterSpec.scala

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,16 @@ class SetXContentTypeOptionsFilterSpec extends BaseFunctionalSpec {
5353
.statusIs(404)
5454
.responseContainsHeader(SetXContentTypeOptionsFilter.xContentTypeOptionsHeader, "nosniff".r)
5555
}
56+
57+
"be applied for api definition without accept header" in {
58+
given()
59+
.when()
60+
.get("/api/definition")
61+
.withoutAcceptHeader()
62+
.thenAssertThat()
63+
.statusIs(200)
64+
.responseContainsHeader(SetXContentTypeOptionsFilter.xContentTypeOptionsHeader, "nosniff".r)
65+
}
5666
}
5767

5868
}

0 commit comments

Comments
 (0)