profile
viewpoint

Algebra8/Knots 6

Python Braid Generator Package

Algebra8/attrs 0

Python Classes Without Boilerplate

Algebra8/braidgenerator_doc.github.io 0

Documentation for Braid Generator package

Algebra8/cluster-api-provider-aws 0

Kubernetes Cluster API Provider AWS provides consistent deployment and day 2 operations of "self-managed" and EKS Kubernetes clusters on AWS.

Algebra8/cpython 0

The Python programming language

Algebra8/EventsPipe 0

Backend application for querying and modifying Eventbrite public events

Algebra8/go-database-sql-tutorial 0

A tutorial for Go's database/sql package

Algebra8/LAViewSet 0

A Lyte (light) Asynchronous ViewSet.

Algebra8/MonkeyType 0

A system for Python that generates static type annotations by collecting runtime types

Algebra8/mux 0

A powerful HTTP router and URL matcher for building Go web servers with 🦍

issue commentgorilla/mux

[bug] Documentation for func (*Route) HeadersRegexp is incorrect

Fixed included https://github.com/gorilla/mux/pull/667 :)

Algebra8

comment created time in a day

PR opened gorilla/mux

Fix minor mistake in HeadersRegexp doc

Fixes #666

Summary of Changes

  1. Fixed mistake in HeadersRegexp docs.

PS: Make sure your PR includes/updates tests! If you need help with this part, just ask!

Since this is a doc change I don't think it needs tests.

+1 -1

0 comment

1 changed file

pr created time in a day

create barnchAlgebra8/mux

branch : bug-fix-headers-regexp-doc

created branch time in a day

issue openedgorilla/mux

[bug] Documentation for func (*Route) HeadersRegexp is incorrect

Describe the bug

A clear and concise description of what the bug is.

The documentation example for func (*Route) HeadersRegexp is incorrect:

r := mux.NewRouter()
r.HeadersRegexp("Content-Type", "application/(text|json)",
          "X-Requested-With", "XMLHttpRequest")

mux.NewRouter() returns *mux.Router but HeadersRegexp is defined on *Route. This is a small mistake and is not too dangerous because the next (more verbose) example clarifies the mistake.

However, it's a mistake.

Should be something like:

r := mux.NewRouter().NewRoute()
r.HeadersRegexp("Content-Type", "application/(text|json)",
          "X-Requested-With", "XMLHttpRequest")

Versions

Go version: go version go version go1.16.4 darwin/amd64

package version: run git rev-parse HEAD inside the repo 91708ff8e35bafc8612f690a25f5dd0be6f16864

Steps to Reproduce

How can the bug be triggered?

Expected behavior

What output or behaviour were you expecting instead?

As mentioned above, the example should look like:

r := mux.NewRouter().NewRoute()
r.HeadersRegexp("Content-Type", "application/(text|json)",
          "X-Requested-With", "XMLHttpRequest")

Code Snippets

A minimum viable code snippet can be useful! (use backticks to format it).

created time in a day

fork Algebra8/mux

A powerful HTTP router and URL matcher for building Go web servers with 🦍

http://www.gorillatoolkit.org/pkg/mux

fork in a day

startedbenbjohnson/wtf

started time in a month

fork Algebra8/redigo

Go client for Redis

fork in 2 months

startedstevetarver/sample-data

started time in 3 months

more