Chromium DevTools Protocol - deleteCookies - google-chrome-devtools

I'm trying to use Chromium DevTools protocol, more precisely the Network.deleteCookies method: https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-clearBrowserCookies
And it seems like in the description of the method it is written that the url, domain and path parameters are optional parameters, that is, whether to use them or not is optional.
But when I call this method:
{"id":3,"method":"Network.deleteCookies","params":{"name":"name_cookie"}}
Then comes the error:
{"code":-32602,"message":"At least one of the url and domain needs to be specified"}
Why is that? Tell me please.

Related

How to pass Authentication Header in Flutter WebSocketChannel?

I'm using Flutter web_socket_channel package to communicate with server. The class WebSocketChannel doesn't take a header parameter.
factory WebSocketChannel.connect(Uri uri, {Iterable<String>? protocols}) =>
platform.connect(uri, protocols: protocols);
When using IOWebSocketChannel to pass header, I'm getting Unsupported operation: Platform._version in web like given here. It is working fine in Android and iOS.
The concise answer is: No because only the path in your URI and protocol field can be set up.
Longer answer:
In the pure JS WebSocket API, there is no method to specify extra headers for the browser to send.
You can specify only
GET query(was://mysockets.com/path)
and header protocol called Sec-WebSocket-Protocol
Conclusion: If you can't achieve such functionality in the native code then this functionality is unavailable for your flutter web app
Happy coding

SoapUI REST webservice mock with path parameters

I am trying to create a mock webservice for a POST method on SoapUI. I made a REST Project, then created a MockService, a MockAction and defined a couple responses and resource paths. It works fine if I define a fixed regular path relative to my Service, for example method/postmethod to be invoked at http://localhost:8080/method/post, it works well.
What I want to do, however, is define my method with path parameters, such as this: http://localhost:8080/method/{par1}/{par2}/{par3}/post. The application we want to test, which will be invoking our mock service, uses this type of parameter extensively, so we cannot just create one method for each possible combination.
Is it possible to define a mock POST method with that type of path parameter? Is it possible to parse the parameters and use them in the output response? If yes, then how?
Please enable the script method in responding the request that came to mock, there is a default script posted by soapui , which tells how to access the path parameters, headers, body . please use that , attached the pic for reference.

How can we configure the install4j executable to take query parameters provided in the custom uri to take as arguments to pass to the main app

We have defined custom uri scheme for our Mac OS X using install4j but couldn't find a way to pass query parameters to the app as arguments using custom uri so that those are being passed to the underlying main method as arguments for us to process.
Example :
customuri://?somekey=value
when opened in a browser the app opens up with the parameters to be processed.
The application has to be registered to handle the URL invocation.
This is not related to install4j.
See
Handle custom URL schemes in an OS X Java application

Scala Lift - Robust method to protect files from hotlinking

I'm attempting to implement a way to stop hotlinking and/or un-authorised access to resources within my app.
The method I'm trying to add is something I've used before in PHP apps. Basically a session is set when the page is first called. The images are added to the page via the image tag with the session value as a parameter:
<img src="/files/image/image1.jpg?session=12345" />
When the image is requested the script checks to see if the session is set and matches the provided value. If the condition is not met the serving page returns null. Right at the end to the code I unset the session so further requests from outside the scope of the page will return null.
What would be the best implementation of this method within the lift framework?
Thanks in advance for any help, much appreciated :)
You could use a SessionVar for this purpose. In the SessionVar you’d store a Map[SessionImageId, RealImageId] and upon initialising the Session (i.e. when the page is first loaded) you’d generate some random SessionImageIds which you would map to the real image id. In your html you only expose the shadowed SessionImageId so no-one could trace back the image from the id. When the image is requested, you’d simply look up the real id in the Map.
Info: Exploring Lift, Lift wiki
Of course, if shadowing the ids is not important, you could simply use a SessionVar[Boolean].

How to get request properties in routeStartup plugin method?

I'm developing a multilanguage application, and use routes with translated segments. For multilingual support I created special Multilingual plugin.
To use translated segments I need set translator for Zend_Controller_Router_Route before routes init. So only possible place for this in my plugin is routeStartup method, but there is one problem here - for determine right locale I need to use properties of request (Zend_Controller_Request_Abstract), like module, controller and action names, but they are not defined yet here in routeStartup method. They are already defined, for example, in routeShutdown - but I can't set translator for route there, because it have to be done before routes init.
So what can I do:
can I get request properties somehow in routeStartup
or can I re-setup translator later in routeShutdown
P.S: there is a question with exactly the same problem Zend_Controller_Router_Route: Could not find a translator, but proposed answers is not the option for me, because I can't just retrieve language code from url with Regex, I have much more complicated code to define right language code.
Thanks.
What about putting your code in preDispatch? That's what I personally do when I need to check if the person is logged in. Maybe you can move your code there too?