Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Catalyst: Users

POST data for base64

 

 

Catalyst users RSS feed   Index | Next | Previous | View Threaded


s_dmitriev at inbox

Apr 13, 2012, 1:00 AM

Post #1 of 4 (341 views)
Permalink
POST data for base64

Hello All,

Recently we've developed small web application which, for some cases,
receives data in base64 format, as value of one fields of POST
request.
I've noticed that probably there's something wrong with decoding of
such data. E.g. + will become spaces (it's ok) but %3D still intact.
So we using URI::Decode to finally get what we need.
Hope you will clear my misunderstanding here?
We have latest Catalyst-Runtime (.11).

Thanks, Sergey

--
Love never fails.

_______________________________________________
List: Catalyst [at] lists
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst [at] lists/
Dev site: http://dev.catalyst.perl.org/


bobtfish at bobtfish

Apr 13, 2012, 1:41 AM

Post #2 of 4 (327 views)
Permalink
Re: POST data for base64 [In reply to]

On 13 Apr 2012, at 09:00, Сергей Дмитриев wrote:

> Hello All,
>
> Recently we've developed small web application which, for some cases,
> receives data in base64 format, as value of one fields of POST
> request.
> I've noticed that probably there's something wrong with decoding of
> such data. E.g. + will become spaces (it's ok) but %3D still intact.
> So we using URI::Decode to finally get what we need.

There is no module called URI::Decode?

Either way, I don't think this is a Catalyst problem, and you could probably demonstrate this with a trivial one-liner - given the module you're actually using to decode things..

Cheers
t0m


_______________________________________________
List: Catalyst [at] lists
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst [at] lists/
Dev site: http://dev.catalyst.perl.org/


dakkar at thenautilus

Apr 13, 2012, 2:01 AM

Post #3 of 4 (337 views)
Permalink
Re: POST data for base64 [In reply to]

On 2012-04-13 Сергей Дмитриев <s_dmitriev [at] inbox> wrote:
> Recently we've developed small web application which, for some cases,
> receives data in base64 format, as value of one fields of POST
> request.
> I've noticed that probably there's something wrong with decoding of
> such data. E.g. + will become spaces (it's ok) but %3D still intact.

That does not look very much like base64… it looks much more like the
URI encoding.

(example: the string "a simple example" would encode to
"YSBzaW1wbGUgZXhhbXBsZQ==" in base64, but to "a+simple+example" or
"a%20simple%20example" in a URI)

Incidentally, most browsers will send data URI-encoded for forms, not
base64-encoded.

So I suspect that you data is not really base64.

If I'm correct, than Catalyst should decode the data for you
automatically. How are you accessing the request data? Have you tried
just dumping (via Data::Dumper, or Data::Printer) the value of
$c->request->body_parameters ?

--
Dakkar - <Mobilis in mobile>
GPG public key fingerprint = A071 E618 DD2C 5901 9574
6FE2 40EA 9883 7519 3F88
key id = 0x75193F88

The old complaint that mass culture is designed for eleven-year-olds
is of course a shameful canard. The key age has traditionally been
more like fourteen.
-- Robert Christgau, "Esquire"
Attachments: signature.asc (0.19 KB)


s_dmitriev at inbox

Apr 13, 2012, 3:45 AM

Post #4 of 4 (322 views)
Permalink
Re: POST data for base64 [In reply to]

Thank you t0m. Just needed to make sure for myself it's not Catalyst by design.
Sergey

2012/4/13 Tomas Doran <bobtfish [at] bobtfish>:
>
> On 13 Apr 2012, at 09:00, Сергей Дмитриев wrote:
>
>> Hello All,
>>
>> Recently we've developed small web application which, for some cases,
>> receives data in base64 format, as value of one fields of POST
>> request.
>> I've noticed that probably there's something wrong with decoding of
>> such data. E.g. + will become spaces (it's ok) but %3D still intact.
>> So we using URI::Decode to finally get what we need.
>
> There is no module called URI::Decode?
>
> Either way, I don't think this is a Catalyst problem, and you could probably demonstrate this with a trivial one-liner - given the module you're actually using to decode things..
>
> Cheers
> t0m
>
>
> _______________________________________________
> List: Catalyst [at] lists
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst [at] lists/
> Dev site: http://dev.catalyst.perl.org/



--
Love never fails.

_______________________________________________
List: Catalyst [at] lists
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst [at] lists/
Dev site: http://dev.catalyst.perl.org/

Catalyst users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.