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

Support Query Parameters? #20

Open
jphastings opened this issue Jul 8, 2023 · 3 comments · May be fixed by #21
Open

Support Query Parameters? #20

jphastings opened this issue Jul 8, 2023 · 3 comments · May be fixed by #21
Labels
enhancement New feature or request P3

Comments

@jphastings
Copy link

jphastings commented Jul 8, 2023

Would IPFS be interested in supporting _redirects files with query parameters, similar to Netlify)? (Re: ipfs/kubo#8890). If this seems valuable, I'd put a PR together (here and in ipfs/kubo).

I would find it valuable to be able to write a redirects file similar to the one below, to be able to provide responses to 'dynamic-looking' web-requests (from clients that expect to use specific, query parameter-based, GET APIs) via IPFS:

/things type=:type /things/:type.html 200
/things /things.html 200

(This is identical to the format Netlify uses — only required parameters must be specified.)

GET /things?type=photos → Served from /things/photos.html
GET /things → Served from /things.html

jphastings added a commit to jphastings/go-ipfs-redirects-file that referenced this issue Jul 9, 2023
Code now parses and `MatchAndExpandPlaceholders` for query parameters as
well as paths.

Placeholders are shared between the two.

This commit codifies some of the previously implicit edgecases,
particularly around duplicate placeholders.

Closes ipfs#20
@jphastings jphastings linked a pull request Jul 9, 2023 that will close this issue
@jphastings
Copy link
Author

I ended up implementing it anyway 😅

Let me know your thoughts!

jphastings added a commit to jphastings/go-ipfs-redirects-file that referenced this issue Jul 9, 2023
Code now parses and `MatchAndExpandPlaceholders` for query parameters as
well as paths.

Placeholders are shared between the two.

This commit codifies some of the previously implicit edgecases,
particularly around duplicate placeholders.

Closes ipfs#20
jphastings added a commit to jphastings/go-ipfs-redirects-file that referenced this issue Jul 9, 2023
Code now parses and `MatchAndExpandPlaceholders` for query parameters as
well as paths.

Placeholders are shared between the two.

This commit codifies some of the previously implicit edgecases,
particularly around duplicate placeholders.

Closes ipfs#20
jphastings added a commit to jphastings/go-ipfs-redirects-file that referenced this issue Jul 9, 2023
Code now parses and `MatchAndExpandPlaceholders` for query parameters as
well as paths.

Placeholders are shared between the two.

This commit codifies some of the previously implicit edgecases,
particularly around duplicate placeholders.

Closes ipfs#20
@aschmahmann
Copy link

This is effectively a spec change so should be resolved via a proposed IPIP change (https://github.com/ipfs/specs/tree/main#interplanetary-improvement-process-ipip) in https://github.com/ipfs/specs.

The proposal template highlights some questions around benefits, alternatives, tradeoffs, etc. that would likely be helpful to reviewers.

From what I can tell it seems like this could potentially introduce problems for users as new proposals come along that natively add query parameters to the URI such as IPIP-402. It would effectively add a sense of non-reproducibility to ipfs:// URIs (i.e. the actual target resource changing not just something like how a directory is rendered in HTML) which seems like something to be avoided if possible.

@jphastings
Copy link
Author

jphastings commented Oct 18, 2023

Thank you so much @aschmahmann! This is super helpful feedback; I'll review IPIP-402 (and any others referencing the HTTP gateway) and build an IPIP of my own.

@aschmahmann aschmahmann added the enhancement New feature or request label Oct 23, 2023
@lidel lidel added the P3 label Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request P3
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants