Skip to content

Commit

Permalink
Encode + in resumptionToken - #23
Browse files Browse the repository at this point in the history
  • Loading branch information
justinkelly authored and miku committed Sep 27, 2021
1 parent b9432f2 commit a6ef46d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions request.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"fmt"
"net/http"
"net/url"
"sort"
"regexp"
"sort"
)

var (
Expand Down Expand Up @@ -84,11 +84,11 @@ func (r *Request) URL() (*url.URL, error) {
if r.ResumptionToken != "" {
v.Add("resumptionToken", r.ResumptionToken)
var encodedValues string
matched, _ := regexp.MatchString(` |\+`, r.ResumptionToken)
if matched {
matched, _ := regexp.MatchString(` |\+`, r.ResumptionToken)
if matched {
// http://opencontext.org/oai/request has spaces in tokens
// ExLibris Rosetta has + characters in tokens so encode in
// Encoding in these cases
// Encoding in these cases
encodedValues = v.Encode()
} else {
// Some repos, e.g. http://dash.harvard.edu/oai/request seem to have
Expand Down

0 comments on commit a6ef46d

Please sign in to comment.