mapbox / mapbox/aws-log-replay

"generatepath lb" slices timestamps with colon

Open
#41 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
26
Forks
8
PR merge metrics
No merged PRs in 30d

Description

When running `generatepath lb` on a URL with a number of `:`'s, everything beyond the second-to-last semicolon is removed from the URL, resulting in unexpected URLs returned.

Example URL input (from within a CloudFront log file)

```
GET http://api.example.com:80/v4/mapsam.semicolon-test/2/3/1.vector.pbf?access_token=pk.token&style=mapbox://styles/mapsam/1234@2017-05-31T22:05:32.562Z
```

Results in the following output

```
/v4/mapsam.semicolon-test/2/3/1.vector.pbf?access_token=pk.token&style=mapbox://styles/mapsam/1234@2017-05-31T22
```

It appears it's just related to time stamps. The following URL with a number of semi colons works just fine:

Input
```
GET http://api.example.com:80/v1/thing/my.id?access_token=hello:world&another=thing:with:a:semicolon/and/some//slashes:waka
```

Output
```
/v1/thing/my.id?access_token=hello:world&another=thing:with:a:semicolon/and/some//slashes:waka
```

But adding just a timestamp results in it getting cut off:

Input
```
GET http://api.example.com:80/v1/thing/my.id?time=2017-05-31T22:05:32.562Z
```

Output
```
/v1/thing/my.id?time=2017-05-31T22
```

cc @jakepruitt @springmeyer

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the `generatepath lb` command and its URL parsing entry point, then reproduce the timestamp example from the issue. Done means the full `2017-05-31T22:05:32.562Z` query value and the rest of the URL are preserved, while the existing colon-containing example continues to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.