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

History fails if the server forces that pathnames end in a "/" #2057

Closed
1 of 3 tasks
bunchjesse opened this issue Mar 27, 2017 · 1 comment
Closed
1 of 3 tasks

History fails if the server forces that pathnames end in a "/" #2057

bunchjesse opened this issue Mar 27, 2017 · 1 comment

Comments

@bunchjesse
Copy link

This is a (multiple allowed):

  • bug

  • enhancement

  • feature-discussion (RFC)

  • Swiper Version: 3.4.2

  • Platform/Target and Browser Versions: macOS Sierra, Chrome 57

What you did

My server enforces that pathnames end in a forward-slash "/"

Expected Behavior

Swiper to set the first slide based on the current pathname

Actual Behavior

The first slide is always shown, even if we're using a deep link

Looks like a potential bug in getPathValues:

function() {
    var pathArray = window.location.pathname.slice(1).split('/');
    var total = pathArray.length;
    var key = pathArray[total - 2];
    var value = pathArray[total - 1];
    return { key: key, value: value };
}

This fails if the path ends in a forward slash.

@lock
Copy link

lock bot commented Jun 25, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot added the outdated label Jun 25, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Jun 25, 2018
moyus pushed a commit to moyus/swiper-lite that referenced this issue Sep 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant