Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#10336 closed defect (invalid)

[patch][cla]dojo.hash doesn't set "trailingSpace " as the hash correctly

Reported by: miksago Owned by: Rob Retchless
Priority: high Milestone: 1.4
Component: General Version: 1.4.0b
Keywords: Cc: Rob Retchless
Blocked By: Blocking:

Description

I've been working through writing better test cases for dojo.hash (#10003), and I've noticed that in the test case of setting a hash to a string with a trailingSpace that it isn't being set correctly.

dojo.hash('test ');
dojo.hash(); // should return "test "

Currently dojo.hash("test "); will set the hash to "test " instead of "test%20" which seems to be causing the test to fail in FF3.5

Attachments (1)

hash.diff.js (240 bytes) - added by miksago 10 years ago.
Proposed patch

Download all attachments as: .zip

Change History (7)

Changed 10 years ago by miksago

Attachment: hash.diff.js added

Proposed patch

comment:1 Changed 10 years ago by Adam Peller

Milestone: tbd1.5
Owner: changed from anonymous to Rob Retchless

Standard practice is to comment out the assert until we get it working. You can put in a reference to this ticket.

comment:2 Changed 10 years ago by miksago

The only reason the assert is in there was that it was in the original tests, but written incorrectly / inconsistently.

comment:3 Changed 10 years ago by Adam Peller

Milestone: 1.51.4
Summary: dojo.hash doesn't set "trailingSpace " as the hash correctly[patch][cla]dojo.hash doesn't set "trailingSpace " as the hash correctly

comment:4 Changed 10 years ago by Rob Retchless

@miksago, this is actually behaving as expected. We decided to leave encoding up to the user to enable query-like hashes. If we did an explicit encodeURIComponent on every call, dojo.hash("param=blah&param2=blah2") would be encoded as "param%3Dblah%26param2%3Dblah2" - ugly. This is documented here: http://docs.dojocampus.org/dojo/hash#advanced

comment:5 Changed 10 years ago by Adam Peller

Resolution: invalid
Status: newclosed

comment:6 Changed 10 years ago by miksago

Okay, in that case, we'll need to note that dojo.hash() trims #'s from the start of urls, and spaces from the end of urls.

Note: See TracTickets for help on using tickets.