question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`url` attribute is not read-only

See original GitHub issue
  • I’ve searched for any related issues and avoided creating a duplicate issue.

Description

According to https://developer.mozilla.org/en-US/docs/Web/API/WebSocket, url attribute should be a read-only string, but it’s currently being set as a plain attribute that can be overwritten, and in fact, it’s being undefined on server side. I think this should be replaced by a getter.

Reproducible in:

  • version: 7.3.1
  • Node.js version(s): 15.0.1
  • OS version(s): Ubuntu 20.04

Steps to reproduce:

  1. Create a WebSocket connection
  2. Set the url attribute

Expected result:

Thrown exception about not being able to modify a getter property

Actual result:

The url attribute is updated with any value provided

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
pirannacommented, Nov 7, 2020

Thank you 😃

0reactions
craftdeliverycommented, Dec 18, 2020

I was adding it client side then doing ws.url=req.url

I’m sure I can figure out a workaround

Thanks, Eli Tabello 647.382.7084

On Fri., Dec. 18, 2020, 5:28 p.m. Jesús Leganés-Combarro, < notifications@github.com> wrote:

I was changing the url to add an url param which helped keep track of the user making the request

Not fully sure if that’s the better way to do it… how were you adding the url param? Can you provide some example code?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/websockets/ws/issues/1814#issuecomment-748350228, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJVLENOXIUU5QYMRDT45M6LSVPJSHANCNFSM4THW5AKQ .

Read more comments on GitHub >

github_iconTop Results From Across the Web

HTML attribute: readonly - HTML: HyperText Markup Language
The Boolean readonly attribute, when present, makes the element not mutable, meaning the user can not edit the control.
Read more >
jQuery "not readonly" selector - Stack Overflow
I suppose you are looking for something like the following: $('input:not([readonly="readonly"])'). Have a look at jQuery's various attribute-selectors.
Read more >
HTML DOM Input URL readOnly Property - W3Schools
The readOnly property sets or returns whether a URL field should be read-only, or not. A read-only field cannot be modified. However, a...
Read more >
HTML DOM Input URL readOnly Property
The readOnly property sets or returns whether a URL field should be read-only, or not. A read-only field cannot be modified. However, a...
Read more >
HTML5 Forms: Readonly Type Attribute - Wufoo
The readonly attribute makes a form control non-editable (or “read only”). ... readonly is only relevant for type text, search, url, tel, email,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found