Git Product home page Git Product logo

petitio's People

Contributors

diced avatar headtrixz avatar nytelife26 avatar tbnritzdoge avatar vetlix avatar zero734kr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

petitio's Issues

hooks

Potentially implement a hook api

Non-alphabetical texts like korean get crashed

# original text:
- 타락한 그림자의 반지
# when petitio parses it:
+ í\x83\x80ë\x9D½í\x95\x9C 그림ì\x9E\x90ì\x9D\x98 ë°\x98ì§\x80

Using petitio v1.1.0

When I request to this url, petitio is returning something like:

{
    "ItemInfo": {
        "AcquisitionInfo": {
            "Acquisition_000": [
                null
            ]
        },
        "BasicInfo": {
            "Tooltip_Item_000": [
                null
            ],
            "categoryName": "<FONT COLOR='#FA5D00'>ì ë¬¼ ë°</FONT>",
            "categoryType": "200",
            "enhance": "false",
            "itemId": "212300022",
            "itemLevel": 
                           ì
 ë ë²¨ 960",
            "itemName": "íë 그림ì",
            "maxQualityIndex": "0",
            "minQualityIndex": "0",
            "setItem": "false"
        }
    }
}

but the expected output was:

{
    "ItemInfo": {
        "AcquisitionInfo": {
            "Acquisition_000": [
                null
            ]
        },
        "BasicInfo": {
            "Tooltip_Item_000": [
                null
            ],
            "categoryName": "<FONT COLOR='#FA5D00'>유물 반지</FONT>",
            "categoryType": "200",
            "enhance": "false",
            "itemId": "212300022",
            "itemLevel": "아이템 레벨 960",
            "itemName": "타락한 그림자의 반지",
            "maxQualityIndex": "0",
            "minQualityIndex": "0",
            "setItem": "false"
        }
    }
}

It seems while parsing buffer to json, something is causing to crash non-alphabetical letters like korean.

Code to reproduce:

import fetch from "petitio"

fetch("https://ludy.game.onstove.com:44333/web/ItemDictionary/Select/212300022?_=1617310085179").json().then(console.log)

I'm using nodejs v14.16.0 with linux mint 20.1.

RFC: LGTM -> Codacy & Coveralls -> Codecov

At present, our CI is very slow. LGTM has proven to take over 5 minutes for analysis due to lack of incremental build settings, and Coveralls is inferior to Codecov in terms of functionality and UX. Therefore, I'm proposing we migrate.

Thoughts?

Help us translate our documentation!

Hi! If you're seeing this, you probably got here from our documentation site. If that's the case, and you'd like to help us add translations for a language you're fluent in, then thank you in advance! However, there are also some things to note.

In order to contribute, comment on this issue in the following format.

**I am translating:** "<the sentence you are translating>"
**Which is located at:** <link to the page it is on, and preferably the section too>
**For this language:** <locale name>
**Which corresponds to:** "<the translated text>"
An example

I am translating: "Zero-dependency HTTP library designed to be simple, fast, and type-strong." (the tagline)
Which is located at: https://helperdiscord.github.io/petitio (homepage)
For this language: Latin
Which corresponds to: "A qui est instrumentum ad disposito penitus simplex esse, ieiunium, et etiam factum est, ut hoc non indigere alia instrumental."

benchmark-ci

Run benchmarks on every commit to track performance regressions

refactor: overhaul undici interface

This would solve...

  • #18
    and others.

The implementation should look like...

  • Allow duplex / writeable streams
  • Enable the usage of a pool, agent, or anything that implements a dispatcher as opposed to exclusively an undici client
  • Add redirect infrastructure

Typing will not be difficult as Agent, Pool and Client all implement Dispatcher.

I have also considered...

N/A.

Additional context

N/A.

Using audio stream with petitio

Hey there, I was wondering if it was possible to use an audio stream with petitio while using Transfer-Encoding: chunked.

stream

allow passing a readable into PetitioRequest#body

form-data

a nicer way to use form-data with it being in the peer-deps or we write our own

better body processing

Should improve how we process the body to potentially make it more memory efficient and faster

Error

Bug Description

Error SyntaxError: Unexpected token < in JSON at position 0

Reproducible By

Error SyntaxError: Unexpected token < in JSON at position 0

Expected Behavior

i expected it To Work yeah.

Logs & Screenshots

image

Environment

Additional context

What i need is this API connect to predict smth

SyntaxError: Unexpected token '?'

Bug Description

Never install this directly, though from the error I see it may be a dependency of erela.js. Now whenever I start my program, my console errors with:

/Users/ragnar/GitHub/Ragnarok-Discord/node_modules/petitio/dist/index.js:1
var gt=Object.create,we=Object.defineProperty,yt=Object.getPrototypeOf,bt=Object.prototype.hasOwnProperty,wt=Object.getOwnPropertyNames,Tt=Object.getOwnPropertyDescriptor;var Et=t=>we(t,"__esModule",{value:!0});var $=(t,e)=>()=>(e||(e={exports:{}},t(e.exports,e)),e.exports);var kt=(t,e,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of wt(e))!bt.call(t,s)&&s!=="default"&&we(t,s,{get:()=>e[s],enumerable:!(r=Tt(e,s))||r.enumerable});return t},J=t=>kt(Et(we(t!=null?gt(yt(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var Ne=$((Zt,_e)=>{"use strict";var{HTTPParser:St}=process.binding("http_parser");_e.exports=St});var Te=$((er,Pe)=>{Pe.exports={kUrl:Symbol("url"),kWriting:Symbol("writing"),kResuming:Symbol("resuming"),kQueue:Symbol("queue"),kConnect:Symbol("connect"),kIdleTimeout:Symbol("idle timeout"),kIdleTimeoutValue:Symbol("idle timeout value"),kKeepAli

SyntaxError: Unexpected token '?'
    at wrapSafe (internal/modules/cjs/loader.js:1072:16)
    at Module._compile (internal/modules/cjs/loader.js:1122:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
    at Module.load (internal/modules/cjs/loader.js:1002:32)
    at Function.Module._load (internal/modules/cjs/loader.js:901:14)
    at Module.require (internal/modules/cjs/loader.js:1044:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object.<anonymous> (/Users/ragnar/GitHub/Ragnarok-Discord/node_modules/erela.js/dist/structures/Node.js:18:35)
    at Module._compile (internal/modules/cjs/loader.js:1158:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)

Reproducible By

N/A - Dependancy updated causing error

Environment

Running program on Mac OS - Node.js version 12.16.1

node 16

Petitio will not function on NodeJS 16 due to the removal of process.bindings. This has already been resolved in undici and will be resolved here once we upgrade to the latest version of undici ( #19 )

Reporting a vulnerability

Hello!

I hope you are doing well!

We are a security research team. Our tool automatically detected a vulnerability in this repository. We want to disclose it responsibly. GitHub has a feature called Private vulnerability reporting, which enables security research to privately disclose a vulnerability. Unfortunately, it is not enabled for this repository.

Can you enable it, so that we can report it?

Thanks in advance!

PS: you can read about how to enable private vulnerability reporting here: https://docs.github.com/en/code-security/security-advisories/repository-security-advisories/configuring-private-vulnerability-reporting-for-a-repository

feat: request aborting signal

This would solve...

I think we need a signal. (for request aborting)

The implementation should look like...

It should be something like putting AbortController at option.

I have also considered...

N/A

Additional context

N/A

SyntaxError: Unexpected token in JSON at position 0

Bug Description

Caused by erela js, using nodejs 1.18.10

Reproducible By

Erela js search

Expected Behavior

it search the song

Logs & Screenshots

Lava-Music Logs | Mon 31-10-2022 06:30:46.0210 [::]  Player for the Bot created!
Lava-Music Logs | Mon 31-10-2022 06:30:46.7160 [::]  Logging into the Bot ...
Lava-Music Logs | Mon 31-10-2022 06:30:48.5290 [::]  Shard #0 Ready                                  Lava-Music Logs | Mon 31-10-2022 06:30:48.5340 [::]  Discord Bot is now online and ready to be used! Lava-Music Logs | Mon 31-10-2022 06:30:48.5380 [::]  Bot User: Voidy#6320                            Lava-Music Logs | Mon 31-10-2022 06:30:48.5380 [::]  Guild(s): 3 Servers
Lava-Music Logs | Mon 31-10-2022 06:30:48.5380 [::]  Watching: 60 Members                            Lava-Music Logs | Mon 31-10-2022 06:30:48.5380 [::]  Prefix: <@997723699111280673>                   Lava-Music Logs | Mon 31-10-2022 06:30:48.5380 [::]  Commands: 97                                    Lava-Music Logs | Mon 31-10-2022 06:30:48.5380 [::]  Discord.js: v13.9.2
Lava-Music Logs | Mon 31-10-2022 06:30:48.5380 [::]  Node.js: v18.10.0                               Lava-Music Logs | Mon 31-10-2022 06:30:48.5380 [::]  Plattform: android arm64                        Lava-Music Logs | Mon 31-10-2022 06:30:48.5380 [::]  Memory: 22.98 MB / 84.34 MB
Lava-Music Logs | Mon 31-10-2022 06:30:48.5570 [::]  Set the first Status Text
Lava-Music Logs | Mon 31-10-2022 06:30:49.3230 [::]  Node connected :: 
Lava-Music Logs | Mon 31-10-2022 06:30:50.3970 [::]  Autoresume - Voice Channel is either Empty / no Listeners / got deleted
SyntaxError: Unexpected token  in JSON at position 0
    at JSON.parse (<anonymous>)
    at Y.json (/data/data/com.termux/files/home/project/discord-js-lavalink-Music-Bot-erela-js/node_modules/petitio/dist/index.js:30:574)
    at ke.json (/data/data/com.termux/files/home/project/discord-js-lavalink-Music-Bot-erela-js/node_modules/petitio/dist/index.js:30:2499)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)                    (node:7833) [DEP0160] DeprecationWarning: The multipleResolves event has been deprecated.
(Use `node --trace-deprecation ...` to show where the warning was created)

Environment

Termux Android, NodeJS 1.18.10

Additional context

Redirect not working

This would solve...

It does not redirect even response has Location header.

The implementation should look like...

It would be great if it redirects. (Just like other library such as node-fetch)

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.