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

TykTechnologies / tyk / 2950 / 2

Build:
DEFAULT BRANCH: master
Ran 13 Sep 2017 09:42AM UTC
Files 84
Run time 3s
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

13 Sep 2017 09:38AM UTC coverage: 44.033% (+0.1%) from 43.917%
LATEST_GO=true

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

Source Files on job 2950.2 (LATEST_GO=true)
  • Tree
  • List 0
  • Changed 2
  • Source Changed 1
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 2950
  • Travis Job 2950.2
  • fc9cf64c on github
  • Prev Job for LATEST_GO=true on master (#2924.2)
  • Next Job for LATEST_GO=true on master (#2955.2)
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