Code Monkey home page Code Monkey logo

Comments (7)

vin047 avatar vin047 commented on June 1, 2024 1

Ah thats brilliant, thanks!

from connectivity.

rwbutler avatar rwbutler commented on June 1, 2024

The current implementation only checks that the word 'Success' is returned in the response so that would work.

I meant to get around to writing a more robust implementation of this check just in case it ever turns out to be the case that captive portal happens to contain the word as part of the web page served however I'll ensure that I introduce this in a backwards-compatible manner when I do. Hope this helps!

from connectivity.

rwbutler avatar rwbutler commented on June 1, 2024

I've added the option to customise the validity test used when checking connectivity URLs. To only check that the response contains the word Success you can set the following:

connectivity.expectedResponseString = "Success" // this is the default value
connectivity.validationMode = .containsExpectedResponseString

from connectivity.

vin047 avatar vin047 commented on June 1, 2024

Hey @rwbutler, is there any way of being able to set an authorization header token for a connectivity URL? I have an API endpoint thats protected using JWT tokens. Currently have to run a separate unprotected route for checking connectivity status - just wondering if there's an easy way around this, as it would be good to allow only authorised clients to access the endpoint.

from connectivity.

rwbutler avatar rwbutler commented on June 1, 2024

I haven’t got a way of doing this just yet but I’ll look into it and get back to you 👍🏻

Sent with GitHawk

from connectivity.

rwbutler avatar rwbutler commented on June 1, 2024

@vin047 I've just released v2.2.0 which includes a bearerToken property. If you set your JWT token here it should be supplied to your endpoint. Hope this helps.

from connectivity.

vin047 avatar vin047 commented on June 1, 2024

Hey, sorry for the delay in getting back to you. I just had a chance to implement version 2.2.0 and can confirm the bearerToken feature works as expected. Thanks a lot for the effort and for this library! 👍 🥇

from connectivity.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.