Skip to content

Traditional urls getting rewritten if period (.) is in the hash #316

Open
@patrickliechty

Description

@patrickliechty

We are using history 1.7.1. We have cases where a period is part of the a hash parameter value. In onPopState in History.js it calls replaceState because it says it found a state. This causes a rewrite of the url from:

http://localhost:5000/search/record/results#count=20&query=%2Bgivenname%3Apatrick~%20%2Bsurname%3Ajones.~

to

http://localhost:5000/search/record/count=20&query=+givenname:patrick~%20+surname:jones.~

All because it is thinks it is a traditional url. Here is the function:

    History.isTraditionalAnchor = function(url_or_hash){
        // Check
        var isTraditional = !(/[\/\?\.]/.test(url_or_hash));
        // Return
        return isTraditional;
    };

Why isTraditionalAnchor looking for a period? I don't understand how a tradition anchor is determined by a / . or ?

At any rate, it appears to be a bug unless I am not understanding this. It is not fixed in 1.8.0 either.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions