Skip to content

Commit

Permalink
Update post.js
Browse files Browse the repository at this point in the history
http сейчас выдает 307 код (редирект), поэтому падает спелчекер

curl -v 'http://speller.yandex.net/services/spellservice/checkTexts' --data-raw 'text=%D0%9F%D1%80%D0%B0%D0%B2%D0%B5%D1%80%D0%BA%D0%B0&lang=&options=&format='
  • Loading branch information
Pomkaize committed Nov 8, 2023
1 parent 14b3004 commit b1d1ece
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/post.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

const querystring = require('querystring');
const http = require('http');
const https = require('https');

const ETIMEDOUT = 'Request timed out.';

Expand All @@ -10,15 +10,15 @@ function post(params, callback) {
const options = {
host: params.host,
path: params.path,
port: 80,
port: 443,
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': Buffer.byteLength(form)
}
};

let req = http.request(options, function(res) {
let req = https.request(options, function(res) {
let textBuffer = '';

res.setEncoding('utf8');
Expand Down

0 comments on commit b1d1ece

Please sign in to comment.