f



AWS vs encode '#'

I'm working on a web server that handles downloading music to my PDA, using=
 AWS. One of the music file names is (in part):

01 The Dance #1.mp3

The "#" is part of the file name; it does _not_ indicate a "fragment" part =
of a URL.

However, if I send a properly encoded "GET" request to the AWS server:

GET .../01%20The%20Dance%20%231.mp3

it arrives in my Handle_Request subprogram with "#1.mp3" in the fragment pa=
rt of the URL (just wrong!).

Tracing through the code, the socket is read in aws-server-http_utils.adb G=
et_Request_Line. That calls aws-server-http_utils.adb Parse_Request_Line, w=
hich _decodes_ the resource string, _then_ calls Status.Set.Request which c=
alls URL.Set.Parse, which puts the "#.mp3" in the fragment.

URL.Decode should be called _after_ URL.Set.Parse, not before.

Has anyone else seen this?=20

I find it hard to believe such a fundamental bug is in AWS; am I missing so=
mething?
0
Stephen
12/20/2016 12:14:50 AM
comp.lang.ada 8774 articles. 2 followers. Post Follow

6 Replies
733 Views

Similar Articles

[PageSpeed] 41

Hello Stephen,

> Has anyone else seen this?=C2=A0

No, you're the first one to report.

> I find it hard to believe such a fundamental bug is in AWS; am I
> missing something?

I fear that indeed this is an AWS bug unnoticed since all this time.

--=20
=C2=A0 Pascal Obry /=C2=A0=C2=A0Magny Les Hameaux (78)

=C2=A0 The best way to travel is by means of imagination

=C2=A0=C2=A0http://www.obry.net

=C2=A0 gpg --keyserver keys.gnupg.net --recv-key F949BD3B
0
Pascal
12/20/2016 3:55:31 PM
On Tuesday, December 20, 2016 at 9:55:34 AM UTC-6, Pascal Obry wrote:
> Hello Stephen,
>=20
> > Has anyone else seen this?=C2=A0
>=20
> No, you're the first one to report.
>=20
> > I find it hard to believe such a fundamental bug is in AWS; am I
> > missing something?
>=20
> I fear that indeed this is an AWS bug unnoticed since all this time.

Ok. I'll see if I can come up with a patch. I'm using GPL 2016; is there a =
public AWS source repository?

0
Stephen
12/20/2016 7:55:06 PM
Hi Stephen,

> Ok. I'll see if I can come up with a patch. I'm using GPL 2016; is
> there a public AWS source repository?

Yes on GitHub, see:
https://github.com/AdaCore/aws

--=20
=C2=A0 Pascal Obry /=C2=A0=C2=A0Magny Les Hameaux (78)

=C2=A0 The best way to travel is by means of imagination

=C2=A0=C2=A0http://www.obry.net

=C2=A0 gpg --keyserver keys.gnupg.net --recv-key F949BD3B
0
Pascal
12/20/2016 9:20:04 PM
On Tuesday, December 20, 2016 at 3:20:06 PM UTC-6, Pascal Obry wrote:
> Hi Stephen,
> 
> > Ok. I'll see if I can come up with a patch. I'm using GPL 2016; is
> > there a public AWS source repository?
> 
> Yes on GitHub, see:
> https://github.com/AdaCore/aws

I'm trying to make that work, in a Debian testing VM. "make setup" fails because the "templates_parser" directory is empty.

Is that supposed to be populated from some other git repository? Neither INSTALL nor readme.txt say that.

Is there a better mailing list to discuss this?
0
Stephen
12/22/2016 8:17:22 PM
Stephen Leake <stephen_leake@stephe-leake.org> writes:

> On Tuesday, December 20, 2016 at 3:20:06 PM UTC-6, Pascal Obry wrote:
>> Hi Stephen,
>> 
>> > Ok. I'll see if I can come up with a patch. I'm using GPL 2016; is
>> > there a public AWS source repository?
>> 
>> Yes on GitHub, see:
>> https://github.com/AdaCore/aws
>
> I'm trying to make that work, in a Debian testing VM. "make setup"
> fails because the "templates_parser" directory is empty.

I think you are meant to clone using --recursive, because
templates_parser is a submodule.

  --recursive, --recurse-submodules
     After the clone is created, initialize all submodules within, using
     their default settings. This is equivalent to running git submodule
     update --init --recursive immediately after the clone is finished.
     This option is ignored if the cloned repository does not have a
     worktree/checkout (i.e. if any of --no-checkout/-n, --bare, or
     --mirror is given)

> Is that supposed to be populated from some other git repository?
> Neither INSTALL nor readme.txt say that.

Looks like an issue needs raising.

> Is there a better mailing list to discuss this?

At the bottom of readme.txt it suggests
http://lists.adacore.com/mailman/listinfo/aws
0
Simon
12/23/2016 8:16:20 AM
On Friday, December 23, 2016 at 2:16:22 AM UTC-6, Simon Wright wrote:
> Stephen Leake  writes:
> 
> > On Tuesday, December 20, 2016 at 3:20:06 PM UTC-6, Pascal Obry wrote:
> >> Hi Stephen,
> >> 
> >> > Ok. I'll see if I can come up with a patch. I'm using GPL 2016; is
> >> > there a public AWS source repository?
> >> 
> >> Yes on GitHub, see:
> >> https://github.com/AdaCore/aws
> >
> > I'm trying to make that work, in a Debian testing VM. "make setup"
> > fails because the "templates_parser" directory is empty.
> 
> I think you are meant to clone using --recursive, because
> templates_parser is a submodule.

Ok, that works.

> At the bottom of readme.txt it suggests
> http://lists.adacore.com/mailman/listinfo/aws

I posted my original issue, with a patch. I'll raise the issue of submodule checkout.
0
Stephen
12/23/2016 9:21:03 PM
Reply: