Skip to content

Commit

Permalink
fix: allow @ characters in path params
Browse files Browse the repository at this point in the history
  • Loading branch information
troch committed Jul 11, 2018
1 parent 857b5db commit d773d8e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion modules/rules.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const defaultOrConstrained = (match: string): string =>
'(' +
(match ? match.replace(/(^<|>$)/g, '') : "[a-zA-Z0-9-_.~%':|=+\\*]+") +
(match ? match.replace(/(^<|>$)/g, '') : "[a-zA-Z0-9-_.~%':|=+\\*@]+") +
')'

export type RegExpFactory = (match: any) => RegExp
Expand Down
4 changes: 2 additions & 2 deletions test/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,8 @@ describe('Path', function() {
it('should support a wide range of characters', () => {
const path = new Path('/test/:param')

path.test('/test/1+2=3').should.eql({
param: '1+2=3'
path.test('/test/1+2=3@*').should.eql({
param: '1+2=3@*'
})
})
})

0 comments on commit d773d8e

Please sign in to comment.