When does app engine serialise the http response?

80 views
Skip to first unread message

b...@soliduslink.com

unread,
Jun 6, 2018, 10:56:08 AM6/6/18
to Google App Engine
Hi,

I am trying to set the headers on the http response but realised in some cases the http response has been serialised and the setHeader() function will fail. When exactly does app engine serialise the http response?

Best,
Baojun

John Clute

unread,
Jun 6, 2018, 1:09:24 PM6/6/18
to Google App Engine
It looks like a signed Character problem,  It is expecting a value under 127, if it were a unsigned character the ORD value up is 0 to 255, would be OK, 0xE2 converts to 226 Decimal.  The interpreter may be defaulting to a signed characters in this version.  So you may want to force it to make characters variables unsigned.

MyKellySue

unread,
Jun 6, 2018, 1:32:01 PM6/6/18
to google-a...@googlegroups.com

John,

 

If you like I can forward this to them or maybe you should email them directly. ??? Because it is your work.

 

Kelly

 

Sent from Mail for Windows 10

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengi...@googlegroups.com.
To post to this group, send email to google-a...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/5ea0e3be-cd49-4c74-8e37-528cc79679e0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

 

George (Cloud Platform Support)

unread,
Jun 6, 2018, 2:57:58 PM6/6/18
to google-a...@googlegroups.com
Hello Baojun, 

How did you determine that response headers are serialized at an unexpected moment? If this happens in some cases, would you be able to indicate which such cases have you been faced with? How can one reproduce this serialized header situation? You may refer to the documentation, in particular the "Request responses" sub-chapter of the "Request Headers and Responses" online document. 

Baojun Xu

unread,
Jun 11, 2018, 5:05:53 AM6/11/18
to google-a...@googlegroups.com
Hi,

I have a Filter to add a HTTPONLY flag on the JSESSIONID cookie, where I got the following exception. Just wondering how do I add the flag before the response is committed.

[INFO] GCLOUD: java.lang.IllegalStateException: Response has already been committed

[INFO] GCLOUD: at com.google.appengine.repackaged.com.google.common.base.Preconditions.checkState(Preconditions.java:501)

[INFO] GCLOUD: at com.google.appengine.tools.development.ResponseRewriterFilter$ResponseWrapper.checkNotCommitted(ResponseRewriterFilter.java:627)

[INFO] GCLOUD: at com.google.appengine.tools.development.ResponseRewriterFilter$ResponseWrapper.reset(ResponseRewriterFilter.java:606)

[INFO] GCLOUD: at com.google.appengine.tools.development.jetty9.StaticFileUtils.passConditionalHeaders(StaticFileUtils.java:121)

[INFO] GCLOUD: at com.google.appengine.tools.development.jetty9.LocalResourceFileServlet.doGet(LocalResourceFileServlet.java:175)

[INFO] GCLOUD: at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)

[INFO] GCLOUD: at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)


Best,
Baojun

On Wed, Jun 6, 2018 at 8:57 PM, 'George (Cloud Platform Support)' via Google App Engine <google-a...@googlegroups.com> wrote:
Hello Baojun, 

How did you determine that response headers are serialized? If this happens in some cases, would you be able to indicate which such cases have you been faced with? How can one reproduce this serialized header situation? You may refer to the documentation, in particular the "Request responses" sub-chapter of the "Request Headers and Responses" online document. 

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengine+unsubscribe@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Baojun Xu

SolidusLink AG
Rütistrasse 16
8952 Schlieren

George (Cloud Platform Support)

unread,
Jun 13, 2018, 7:31:15 PM6/13/18
to Google App Engine
How do you set your JSESSIONID cookie? How do you use response.setHeader() in your code? A relevant sample of your code is needed, to be able to examine and eventually reproduce the issue. You may send this via private message, to maintain the desired level of privacy. 

This discussion group is oriented more towards general opinions, trends and issues of general nature touching the app engine. For coding and programming architecture, you may be better served in a forum such as stackoverflow, where experienced programmers are within reach and ready to help.  
Reply all
Reply to author
Forward
0 new messages