davis / backbone-router-test

a test repo to show that %20s are being turned into spaces when using Router#navigate

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Purpose

This repo was created to demonstrate a bug/weird behavior of Backbone.Router#navigate.

Test case

var Backbone = require('backbone');

var router = new Backbone.Router();
Backbone.history.start();

router.navigate('space%20space');

Expected result

Url looks something like http://localhost:3000/space%20space

Actual result

Url looks like http://localhost:3000/space space

Why this is a problem

This breaks URLs when copy pasting them, etc, and in general is inconsistent behavior, because none of the other URLencoded chars get decoded.

How to see it for yourself

git clone git@github.com:davis/backbone-router-test.git
cd backbone-router-test
open index.html

About

a test repo to show that %20s are being turned into spaces when using Router#navigate


Languages

Language:JavaScript 100.0%Language:HTML 0.0%