-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTTP header 'Authorization: XXXXXXXX' is not allowed in responses #7549
Comments
Note: I tried to workaround with the |
Work around "HTTP header 'Authorization: XXXX' is not allowed in responses Ref: playframework/playframework#7549
The correct configuration key is http://doc.akka.io/docs/akka-http/current/scala/http/configuration.html I'm not sure that changing it will solve this problem, But it shouldn't be necessary to manually configure it to standard headers anyway. |
well basically this is not a defect, since |
@marcospereira I tried with following lines in my
Even with all this values, my @schmitch Why this particular header is incorrect in a response header? Basically, what I try to do is to manage credentials information with refreshing data (JWT token with expiration date). For each request with a valid I should be blind (or don't know which request to send to google 👅 ) , but I didn't find anything about that particular header unsuitable to the response part. I agree with your second part about the parsing error is unsuitable since play 2.5 never enforced it. |
you need to use devSettings Example:
inside your The header is incorrect since it's a client only header. for your use case it's better to create a "custom" header, i.e. |
Two more tests:
Both cases: the The RFC defines the use of this header as to contain the credentials of the client. And show an example with the request. But in my case, it's really the credentials of the client, refreshed by the server. |
The problem here is that, while
So, while it is not illegal to have an @Isammoc could you please explain better why do you need to send |
@marcospereira As the Currently, I need to have same name for header in request and response. (the current version of the jwt-play plugin does not allow me to configure different name for request and response. As my JWT is about credentials of the client, I want to use I will ask to the jwt-play plugin for the feature to have separate configuration for request and response header name. But |
Agree that it should be treated as a custom header. No problem with that. |
* only warn the user if a response header is invalid #7549 currently previous play versions allowed illegal response headers. however akka-http enforces them, so we check if a response header is renderable in responses and if not, we convert them to a RawHeader * add mima filter
* only warn the user if a response header is invalid #7549 currently previous play versions allowed illegal response headers. however akka-http enforces them, so we check if a response header is renderable in responses and if not, we convert them to a RawHeader * add mima filter
Hi @Isammoc, this issue is now addressed in Play 2.6.1 if you want to try it out. |
Tested and approved 🎆 Thanks for the work! ^^ Keep going to do as good a work! Cheers |
Play Version 2.6.0
I am migrating from 2.5.3
API Scala
Operating System (Ubuntu 15.10 / MacOS 10.10 / Windows 10)
Linux desktop 4.10.0-26-generic #30-Ubuntu SMP Tue Jun 27 09:30:12 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
JDK (Oracle 1.8.0_72, OpenJDK 1.8.x, Azul Zing)
java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
Library Dependencies
I try to migrate my application based on jwt-play.
Expected Behavior
Please describe the expected behavior of the issue, starting from the first action.
Result.withHeaders
Actual Behavior
No error, only a log :
The response is served (200 OK, or other), but the header is not here.
Reproducible Test Case
.withHeaders("Authorization" -> "Bearer 1234")
at the end of line 22 inHomeController.scala
(add headers to the Ok result)Authorization
header is not renderedThe text was updated successfully, but these errors were encountered: