inconshreveable/ngrok — pull request #33 by NickPresta (2013-09-26 05:40:11+00:00)
Title: Limiting the length of the request's path.

## My attempt

Attempting to solve issue https://github.com/inconshreveable/ngrok/issues/30

The solution was limiting the path to 25 characters total (24 + the beginning `/`)

The approach I took was:

1. Explode the path into 26 parts.
2. Join the first 25 parts to get the "truncated" path

This handles unicode very nicely as well, although https://github.com/nsf/termbox-go/pull/21 prevents this solution from working on non-ascii paths.

The alternative approach I also tried was: https://gist.github.com/NickPresta/6710165 which was essentially "inspired" by http://golang.org/src/pkg/strings/strings.go#L15 (splitting without appending the reminding string). I can use this instead if you prefer.

## Pictures
![screen shot 2013-09-26 at 1 28 24 am](https://f.cloud.github.com/assets/49090/1215620/89ed18de-266d-11e3-8499-ded9277127bc.png)

The unicode path problem I mentioned above looks like this:
![screen shot 2013-09-26 at 1 38 23 am](https://f.cloud.github.com/assets/49090/1215627/ea575842-266d-11e3-815d-f6d5b0492876.png)
(This happens in the current version, as well). Once https://github.com/nsf/termbox-go/pull/21 is fixed, this is an easy fix.