Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix minor typos. #263

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
dist: xenial
language: java
jdk:
- oraclejdk8
# no longer available
#- oraclejdk7
- openjdk7
- openjdk8
- openjdk10
branches:
only:
- master
Expand Down
6 changes: 3 additions & 3 deletions wayback-cdx-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ For example, if given the url: *archive.org/about/* and:

The matchType may also be set implicitly by using wildcard '*' at end or beginning of the url:

* If url is ends in '/\*', eg **url=archive.org/\*** the query is equivalent to **url=archive.org/&matchType=prefix**
* if url starts with '\*.', eg **url=\*.archive.org/** the query is equivalent to **url=archive.org/&matchType=domain**
* If url is ends in '/\*', e.g. **url=archive.org/\*** the query is equivalent to **url=archive.org/&matchType=prefix**
* if url starts with '\*.', e.g. **url=\*.archive.org/** the query is equivalent to **url=archive.org/&matchType=domain**

(Note: The *domain* mode is only available if the CDX is in SURT-order format.)

Expand Down Expand Up @@ -359,7 +359,7 @@ Currently two restrictions/permission types are supported:
* Access to certain fields, such as filename in the CDX. When restricted, the cdx results contain only public fields.


To allow access, the API key cookie must be explicitly set on the client, eg:
To allow access, the API key cookie must be explicitly set on the client, e.g.:

```
curl -H "Cookie: cdx-auth-token=API-Key-Secret http://mycdxserver/search/cdx?url=..."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,21 @@ public String sniff(Resource resource) {
detector.setText(bbuffer);
CharsetMatch[] matches = detector.detectAll();
if (matches != null) {
for (int i = 0; i < matches.length; i++) {

String charsetNextBest = null;

for (int i = 0; i < matches.length; i++) {
charsetName = matches[i].getName();
if (!isDubious(charsetName) && isCharsetSupported(charsetName)) {
return charsetName;

if (charsetNextBest == null) { charsetNextBest = charsetName; }

// prefer UTF character sets
if (charsetName.startsWith("UTF-8")) { return charsetName; }
}
}

return charsetNextBest;
}
} catch (IOException ex) {
//
Expand All @@ -45,7 +54,7 @@ public String sniff(Resource resource) {

/*
* Pretty much nothing in the wild is really UTF-32,
* yet icu4j returns that as the likeliest possiblity
* yet icu4j returns that as the likeliest possibility
* for several captures...
*/
protected boolean isDubious(String charsetName) {
Expand Down