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

Tidied Up Url Handling #82

Merged
merged 4 commits into from
Sep 12, 2016
Merged

Tidied Up Url Handling #82

merged 4 commits into from
Sep 12, 2016

Conversation

grahammendick
Copy link
Owner

  • Changed History Managers so that the only function that builds Urls is getUrl. Makes it easier to override, e.g., add generic language route parameter for internationalization
  • Accepted empty string as start Url. Protects against server side Url being empty
  • Allowed applicationPath to omit leading slash and ensured HTML5 Urls always have leading slash

Now only have to change getHref and getUrl to implement custom Url,
.e.g., hashbang Url or Url with language like /en/...
Possbile that, on the server, the req.url could be empty string
(although only ever seen '/')
Could happen that url doesn't begin with '/' (manually call
start/navigationLink with url without slash). So, prepended slash. Don't
need to do the same for HashHistory because it doesn't make up the url.
Also prepended applicationPath with / if missing to make the api easier
to use
@grahammendick grahammendick merged commit 1d4e4a7 into master Sep 12, 2016
@grahammendick grahammendick deleted the starturl branch September 12, 2016 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant