foopang / hackbar

Automatically exported from code.google.com/p/hackbar
0 stars 0 forks source link

+ (%2b) character isn't posted correctly. #3

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. use the hackbar with Solr and this kind of urls : 
http://...facet.date=date&f.date.facet.date.gap=%2B1DAY
2. note the '+' isn't a URL encoded space (' ') but the '+' character the 
server expects
3. Load/Split URL (note the splitted URL contains the literal '+' character 
(which seems correct)
4. Execute the query (note the literal '+' (not encoded) in the location bar 
which does NOT seem correct)
5. SolR complains (it caught a space instead of a '+')

with the HackBar 1.4.5

Original issue reported on code.google.com by raphael....@gmail.com on 12 Aug 2010 at 12:18

GoogleCodeExporter commented 9 years ago
Issue 4 has been merged into this issue.

Original comment by pedlag...@gmail.com on 14 Aug 2010 at 3:04

GoogleCodeExporter commented 9 years ago
Aware of this problem. Pending of revision and fix.

Original comment by pedlag...@gmail.com on 6 Sep 2010 at 1:41

GoogleCodeExporter commented 9 years ago
I just encountered this issue when posting base64 data to a website. Attached 
is a patch that should temporarily resolve the issue. All it does is url encode 
the '+' into '%2b' right after the post data is stripped of newlines. I was 
looking into what causes this issue and it seems more related to the global 
Firefox loadURI() function or the nsIMIMEInputStream setData() method, than to 
the HackBar. This at least solves the issue for now until a better solution is 
created.

Original comment by JosiahBr...@gmail.com on 15 Feb 2011 at 1:38

Attachments:

GoogleCodeExporter commented 9 years ago
The regular expression is overkill for replacing the '+', sorry. Patch has been 
modified.

Original comment by JosiahBr...@gmail.com on 15 Feb 2011 at 1:43

Attachments:

GoogleCodeExporter commented 9 years ago
Hi Josiah,

sorry for the late reply... I'm currently without internet connection so no to 
much time to check and update the addon but I'll do my best as soon as I get my 
broadband connection sorted at home ;)

Thanks!

Original comment by pedlag...@gmail.com on 21 Feb 2011 at 9:00

GoogleCodeExporter commented 9 years ago
Well it appears regex was the way to go because I didn't notice that replace 
only replaced the first occurrence. Patch has been modified again using a 
gloabl regex.

Original comment by JosiahBr...@gmail.com on 24 Feb 2011 at 6:07

Attachments:

GoogleCodeExporter commented 9 years ago
Patched applied and functionality is working. It'll be included in the next 
release.

Original comment by pedlag...@gmail.com on 14 Mar 2011 at 12:01

GoogleCodeExporter commented 9 years ago
I did a workaround myself, and added this after line 195 in main.js

postString = postString.replace( new RegExp(/\+/g), " " );

This way, when you load a URL with post parameters using + as spaces, you don't 
send them back as %2b.

Original comment by ppurvia...@gmail.com on 16 Aug 2011 at 10:32