I’m trying the Play Framework (Java) REST API example behind a proxy.
When I try a command line “GET” via httpie, I get a 403.
WM-laptop1:~ $ http --verbose GET localhost:9000/v1/posts
However from Safari it works: http://localhost:9000/v1/posts
All the HTTP filters are disabled, as per the application.conf.
---------- application.conf
jpa.default=defaultPersistenceUnit
Number of database connections
See https://github.com/brettwooldridge/HikariCP/wiki/About-Pool-Sizing
fixedConnectionPool = 9
db.default {
driver = org.h2.Driver
url = “jdbc:h2:mem:play”
Provided for JPA access
jndiName=DefaultDS
Set Hikari to fixed size
hikaricp.minimumIdle = {fixedConnectionPool}
hikaricp.maximumPoolSize = {fixedConnectionPool}
}
disable the built in filters
play.http.filters = play.api.http.NoHttpFilters
Job queue sized to HikariCP connection pool
post.repository {
executor = “thread-pool-executor”
throughput = 1
thread-pool-executor {
fixed-pool-size = ${fixedConnectionPool}
}
}
play.filters.disabled += “play.filters.cors.CORSFilter”
play.filters.disabled += “play.filters.hosts.AllowedHostsFilter”
play.filters.enabled=[]
lazy val root = project.in(file(".")).enablePlugins(PlayScala).disablePlugins(PlayFilters)
WM-laptop1:~ $ http --verbose GET localhost:9000/v1/posts
GET /v1/posts HTTP/1.1
Accept: /
Accept-Encoding: gzip, deflate
Connection: keep-alive
Host: localhost:9000
User-Agent: HTTPie/2.1.0
HTTP/1.1 403 Forbidden