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] don't change the requrest url hash #827

Open
3 tasks done
hongxuWei opened this issue Nov 14, 2023 · 1 comment
Open
3 tasks done

[fix] don't change the requrest url hash #827

hongxuWei opened this issue Nov 14, 2023 · 1 comment
Labels

Comments

@hongxuWei
Copy link

hongxuWei commented Nov 14, 2023

Describe the bug

import request from 'supertest';
import express from 'express';

const app = express();

app.use((req, res, next) => {
  console.log(req.url);
  return next();
});

await request(app).get('/path/to.html?q=1#hash');

expect console.log(req.url); should output '/path/to.html?q=1#hash'
but got '/path/to.html?q=1'

Checklist

  • I have searched through GitHub issues for similar issues.
  • I have completely read through the README and documentation.
  • I have tested my code with the latest version of Node.js and this package and confirmed it is still not working.
@hongxuWei hongxuWei added the bug label Nov 14, 2023
@pckilgore
Copy link

Not a maintainer, but this makes sense to me as not a bug, since client's should not be sending the URL hash to a server:

The search part, if present, is sent as part of the HTTP command, and may in this respect be treated as part of the path. No fragmentid part of a WWW URI (the hash sign and following) is sent with the request.

https://www.w3.org/Addressing/rfc1630.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants