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

HTML UI: Ensure resource creation URIs have no double '/' chars #870

Closed
wants to merge 2 commits into from

Conversation

awoods
Copy link

@awoods awoods commented Aug 5, 2015

var base = $('#main').attr('resource');

// Remove trailing '/' if it exists
var cleanedBase = base.lastIndexOf('/') == base.length - 1 ? base.substr(0, base.length - 1) : base;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it ever be possible that the resource attribute would end in two "/" characters? This JS code will remove a single trailing slash, but not more than one.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not believe the resource can currently find itself in a double '/' situation... but I can add a while-ends-with-slash function to prevent such an issue in the future.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're confident that resource won't end in multiple slashes, we can leave it as-is; otherwise, adding the additional function makes sense to me.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in new commit.

acoburn added a commit that referenced this pull request Aug 8, 2015
@acoburn
Copy link
Contributor

acoburn commented Aug 8, 2015

Resolved via 51545e1

@acoburn acoburn closed this Aug 8, 2015
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.

None yet

2 participants