comp.lang.ada
 help / color / mirror / Atom feed
* AWS and "304 Not Modified" responses
@ 2014-03-27 13:02 Natasha Kerensikova
  2014-03-27 16:43 ` Pascal Obry
  0 siblings, 1 reply; 3+ messages in thread
From: Natasha Kerensikova @ 2014-03-27 13:02 UTC (permalink / raw)


Hello,

I hope I'm not too out-of-topic, but I have a little question about
Ada Web Server: how can I send "304 Not Modified" responses on requests
for contents generated by AWS client (i.e. not files), using
Last-Modified/If-Modified-Since and/or Etag/If-None-Match HTTP headers?

I see that when responding with a File, AWS automatically generates
Last-Modified and respond 304 to appropriate If-Modified-Since
conditional requests; But I haven't seen any way of doing the same thing
on generated content.

While I didn't really expected everything to be handled for me, I'm
really surprised by not finding anything to add custom headers to HTTP
responses.

Am I missing something or is it really impossible?


Thanks for your help,
Natasha

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: AWS and "304 Not Modified" responses
  2014-03-27 13:02 AWS and "304 Not Modified" responses Natasha Kerensikova
@ 2014-03-27 16:43 ` Pascal Obry
  2014-03-28 15:01   ` Natasha Kerensikova
  0 siblings, 1 reply; 3+ messages in thread
From: Pascal Obry @ 2014-03-27 16:43 UTC (permalink / raw)



Hello Natasha,

Am I missing something or is it really impossible?
> 
Yes :)

AWS.Response.Set.Add_Header.

The idea is to build your answer:

   R : Response.Data := Build (...);

And then modify it as needed:

   Response.Set.Add_Header (R, ...);

Hope this helps!


-- 
  Pascal Obry /  Magny Les Hameaux (78)

  The best way to travel is by means of imagination

  http://v2p.fr.eu.org
  http://www.obry.net

  gpg --keyserver keys.gnupg.net --recv-key F949BD3B




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: AWS and "304 Not Modified" responses
  2014-03-27 16:43 ` Pascal Obry
@ 2014-03-28 15:01   ` Natasha Kerensikova
  0 siblings, 0 replies; 3+ messages in thread
From: Natasha Kerensikova @ 2014-03-28 15:01 UTC (permalink / raw)


Hello,

On 2014-03-27, Pascal Obry <pascal@obry.net> wrote:
>> Am I missing something or is it really impossible?
>
> AWS.Response.Set.Add_Header.
>

Indeed, that's exactly what I needed, thanks a lot.

It seems I missed it because I went through code only with specific
grep, which doesn't return general functions like this Add_Header. I
then used the documentation at http://docs.adacore.com/aws-docs/aws/
I was clear from the structure that I needed something in AWS.Response
or one of its children, but chapter 13 doesn't list any child, hence my
asking here.

This raises the question, why is there no mention of AWS.Response.Set in
the documentation? (except for a single occurrence of
AWS.Reponse.Set.Clear_Session in a comment).
Is it the documentation lagging behind a new feature?
Or is AWS.Response.Set part of internal facilities that aren't covered
by the implicit stability promises of documented API?


Thanks again for the help,
Natasha


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-03-28 15:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-27 13:02 AWS and "304 Not Modified" responses Natasha Kerensikova
2014-03-27 16:43 ` Pascal Obry
2014-03-28 15:01   ` Natasha Kerensikova

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox