playframework / playframework/play1

Error responses are not processed by Play Plugins and headers are stripped

Open
#1,420 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
1.6k
Forks
671
Avg merge
12d 15h
Merged PRs (30d)
1

Description

Play Version 1.5.x - 1.7.x
Operating System (Ubuntu 15.10 / MacOS 10.10 / Windows 10)

Ubuntu

JDK (Oracle 1.8.0_72, OpenJDK 1.8.x, Azul Zing)

Paste the output from java -version at the command line.

Expected Behavior

If the application returns a 404, 500 or other error code, I'd expect any changes to the response to still apply.
For example setting of security headers such as X-Frame-Options, or Content-Security-Policy.

Actual Behavior

When returning a 404 or 500 (and other errors), the resulting response is a 'new response' created within play.server.PlayHandler#serve404 which does not contain any headers.

This means that if you have a Play Plugin which is designed to add security headers, those headers are not present on error responses.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in play.server.PlayHandler#serve404 and trace how 404, 500, and other error responses are created. Compare that path with normal responses and the processing performed by Play Plugins. Done means plugin-added security headers, including X-Frame-Options and Content-Security-Policy, remain present on error responses.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.