Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
GoogleCodeExporter opened this issue Jun 20, 2015 · 8 comments
Closed

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

GoogleCodeExporter opened this issue Jun 20, 2015 · 8 comments

Comments

@GoogleCodeExporter
Copy link

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
Copy link
Author

Issue 4 has been merged into this issue.

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

@GoogleCodeExporter
Copy link
Author

Aware of this problem. Pending of revision and fix.

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

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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

  • Changed state: Verified

@GoogleCodeExporter
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant