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

gateway: don't redirect to trailing slash if it's go get #3963

Merged
merged 1 commit into from Jun 9, 2017

Conversation

Projects
None yet
2 participants
@lgierth
Member

lgierth commented Jun 8, 2017

This enables go get to parse go-import meta tags from index.html files stored in IPFS. One tiny step toward whyrusleeping/gx-go#2.

For an import like ipfs.io/ipfs/QmFoo/mypkg, the gateway would previously redirect to /ipfs/QmFoo/mypkg/ (note the trailing slash), which the go get tool can't deal with. Thankfully, go get sets a URL query parameter (?go-get=1) which we can use to switch off the redirect in this case.

gateway: don't redirect to trailing slash if it's go get
This enables `go get` to parse go-import meta tags from index.html
files stored in IPFS. One tiny step toward whyrusleeping/gx-go#2.

For an import like `ipfs.io/ipfs/QmFoo/mypkg`, the gateway would
previously redirect to `/ipfs/QmFoo/mypkg/` (note the trailing slash),
which the `go get` tool can't deal with.

Thankfully, `go get` sets a URL query parameter (`?go-get=1`) which
we can use to switch off the redirect in this case.

License: MIT
Signed-off-by: Lars Gierth <larsg@systemli.org>

@lgierth lgierth added the gateway label Jun 8, 2017

@lgierth lgierth requested a review from Kubuxu Jun 8, 2017

@lgierth lgierth added the in progress label Jun 8, 2017

@lgierth lgierth referenced this pull request Jun 8, 2017

Open

make paths compatible with 'go get' #2

1 of 3 tasks complete
@whyrusleeping

LGTM, thanks @lgierth :)

@whyrusleeping whyrusleeping merged commit 67828a4 into master Jun 9, 2017

6 of 9 checks passed

ci/circleci A command timed out during your tests
Details
continuous-integration/travis-ci/pr The Travis CI build failed
Details
continuous-integration/travis-ci/push The Travis CI build failed
Details
codeclimate no new or fixed issues
Details
codecov/patch 100% of diff hit (target 63.92%)
Details
codecov/project Absolute coverage decreased by -28.5% but relative coverage increased by +36.07% compared to eef022c
Details
commit-message-check/gitcop All commit messages are valid
Details
continuous-integration/jenkins/branch This commit looks good
Details
continuous-integration/jenkins/pr-merge This commit looks good
Details

@whyrusleeping whyrusleeping deleted the feat/gateway-go-get branch Jun 9, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment