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

Invalid Content-Type for HTTPS requests #304

Closed
EtienneBruines opened this issue May 28, 2024 · 3 comments
Closed

Invalid Content-Type for HTTPS requests #304

EtienneBruines opened this issue May 28, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@EtienneBruines
Copy link

EtienneBruines commented May 28, 2024

Describe the bug
When configuring a connection that uses the HTTPS scheme (potentially also HTTP, havent' tested), there is a HTTP POST request to /mypath/rpc. This HTTP request has a request HTTP header Content-Type: text/plain;charset=UTF-8. This results in a HTTP response saying invalid HTTP header (content-type) with status 400 Bad Request.

Regardless of whether or not the SurrealDB (v1.5.1) should be able to parse this correctly (surrealdb/surrealdb#4106), the correct value would be application/json.

The payload for this HTTP request is this, so I'm assuming it's part of the "version checking" logic:

{"id":1,"method":"version"}

To Reproduce
Steps to reproduce the behavior:

  1. Configure a connection with "HTTPS"
  2. Open the browser developer tools Network tab
  3. Try to connect
  4. See error

Expected behavior
A HTTP 200 response (or better yet, a correct Content-Type request header).

Environment:
Platform: Web
Navigator: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36
Version: 2.0.6
Flags: featureFlags: false, models_view: true, apidocs_view: true, themes: false, newsfeed: true

@EtienneBruines EtienneBruines added the bug Something isn't working label May 28, 2024
@EtienneBruines
Copy link
Author

Potentially already fixed in the dev version, since this seems to use application/cbor?

@macjuul
Copy link
Contributor

macjuul commented May 31, 2024

This may now be resolved in the 2.1 release. Could you confirm this?

@macjuul macjuul added the awaiting response Waiting for a reply from submitter label May 31, 2024
@EtienneBruines
Copy link
Author

@macjuul Confirmed, awesome!

@macjuul macjuul removed the awaiting response Waiting for a reply from submitter label Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants