Skip to content

URL encoded %2F character - #57

Merged
chadwhitacre merged 0 commit into
masterfrom
collapse-path-parts
Sep 6, 2013
Merged

chadwhitacre merged 0 commit into
masterfrom
collapse-path-parts

Conversation

@chadwhitacre

Copy link
Copy Markdown
Contributor

I hadn't noticed this until today, which may show my lack of attention lately, but is there any reason we're URL encoding the / into %2F in Shields.io URLs like this one:

http://shields.io/travis-ci/rails%2Frails.png

Seems clear we can't replace the / with another character like _ as I'm guessing we're doing this to keep the whole org/repo combo inside of the image's filename.

@whit537 is there a way we could avoid doing that to make the URLs more transparent/legible? This is not a make or break issue at all, I'm just curious.

@ghost ghost assigned chadwhitacre Sep 5, 2013
@chadwhitacre

Copy link
Copy Markdown
Contributor

%2F is the percent-encoding of /. If we don't percent-encode it, it's treated as a path part separator. You would prefer http://shields.io/travis-ci/rails/rails.png, I take it?

@jhermann

jhermann commented Sep 5, 2013

Copy link
Copy Markdown

Encoded slashes can be a pain in the neck, especially when it comes to proxying etc. Any reason except “it always was that way” for using %2f?

@chadwhitacre

Copy link
Copy Markdown
Contributor

@jhermann It was the most natural way to go, because Aspen (the web framework in use) uses the filesystem for routing. We can avoid %2f without too much trouble, though.

@olivierlacan

Copy link
Copy Markdown
Member Author

@whit537 I understand the design decision behind http://shields.io/travis-ci/rails%2Frails.png to keep both the org and the repo inside the file name and not using just the repo name, but I have to admit I would find http://shields.io/travis-ci/rails/rails.png more elegant and easy to understand.

@chadwhitacre

Copy link
Copy Markdown
Contributor

Huzzah! I just used the GitHub API to promote this issue to a pull request! 💃

@chadwhitacre

Copy link
Copy Markdown
Contributor

sigh Looks like I effed this up after all. :-(

I wanted to change the commit with which I promoted this to a PR (because I included a change to a file in there that I didn't actually mean to). So I git reset locally and force-pushed. But actually I only had one commit on here and not two as I had thought, so when I reset the branch head was the same as master and GitHub closed this PR, merging 0 commits (or ∞ commits, if you look above at the "Commits" tab). I pushed a new commit with the same branch but that isn't being recognized any longer as being part of this PR. Oh well. :-(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

question Support questions, usage questions, unconfirmed bugs, discussions, ideas

Development

Successfully merging this pull request may close these issues.

3 participants