• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

TykTechnologies / tyk / 2950

Build:
DEFAULT BRANCH: master
Ran 13 Sep 2017 09:42AM UTC
Jobs 1
Files 84
Run time 4s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
2950

push

travis-ci

mvdan
Fix SkipUrlClean by not using DefaultServeMux

The issue itself happen because we wrap `gorilla.Mux` router through
`http.ServeMux`, which is kinda wrong, because `Mux` is already a
`ServeMux` implementation. So we processing routes twice.

Default `ServeMux` implementation have own route sanitization logic, and
can’t be configured with `SkipClean` option, like gorilla
implementation.

The solution here is to stop using ServeMux and use Gorilla directly.

Problem with this approach is that we need to reload, eg. replace, the
router inside `doReload` function. Neither gorilla or ServeMux support
replacing the routes, so replacing the whole router object is the only
solution. When we pass raw Gorilla Router object to the
`Server.Handler`, and replace `mainRouter` in `doReload`, server do not
see the changes: thats why we had issues when API reloads was not
working.

There are 2 ways to solve this issue: expose server object as a global
variable, and dynamically replace `Handler` attribute, or write simple
`http.Handler` wrapper around `mainRouter`, which always calls the
current router.

I’m not sure about safety of this approach but since previously we
replaced `DefaultServeMux` directly, and had no any issues, I may assume
that it should be thread safe.

Should fix #1093

5937 of 13483 relevant lines covered (44.03%)

0.48 hits per line

Jobs
ID Job ID Ran Files Coverage
2 2950.2 (LATEST_GO=true) 13 Sep 2017 09:42AM UTC 0
44.03
Travis Job 2950.2
Source Files on build 2950
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #2950
  • fc9cf64c on github
  • Prev Build on master (#2924)
  • Next Build on master (#2955)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc