I received this issue and google isn't providing many case-specific examples to work from. Can anyone decode this? I am not really sure what the main issue is.
I have followed the file path of the first issue to cjs.js file but there isn't much there
"use strict";
const loader = require("./index");
module.exports = loader.default;
And the file path of the second issue leads me to this
var correctedContent = params.removeCR && (os.EOL !== '\\r') ?
sourceContent.replace(ORPHAN_CR_REGEX, ' $1') :
sourceContent;
Github link for context.
I'm having some trouble figuring out how to resolve this issue I'm having with URLs.
Within one of my commands, I'm trying to link to outside sites by doing the following:
this.echo('' + contact[i] + '', {raw: true});
Where philip.contact[contact[0]] is the string "https://medium.com/". I get the following URL from the jquery terminal:
http://philipyoo.github.io/[[!;;]https://medium.com/]
Or I tried the following:
this.echo('' + mylink + '', {raw: true});
And get the following:
http://philipyoo.github.io/https://www.google.com]/
No [[!;;] in the url.
I saw the following closed issue for formatting multiple param urls, but I don't really follow the conversation. I'm not formatting my URLs in any way, but I get situations where I'll get the [[!;;] inserted into my URLs.
Any help is much appreciated!
I'm trying to set up a prestashop webshop and I bought a theme to customize it. Instalation works great, but when reaching the live edit module of the theme I ran into a problem: after customizing the layout I tried to save my modifications, but it returns with 403 error. I've tried to debug it, I've contacted my hosting, I've contacted the developer of the theme, but noone can help me. In the error logs doesn't appear anything regarding this issue. The developer says it is tested on multiple hosts, and it works great. My host says they can't do anything if there is no error message in the logs.
I've managed to circle down the issue a little bit. There is a larger sized parameter(it contains all new configurations) which if I disable to be sent, then I get the following error: "Your hosting provider has set a non-standard or too little value of parameter LimitRequestLine in httpd.conf. Set the default setting value of parameter LimitRequestLine in httpd.conf, please." This error I receive on post and get aswell.
This parameter can be the source of my problem if the http call is through ajax post? Or there is more this issue?
I'm trying to solve this issue for 3 months now, I've spoken to the hosting firm, I've spoken to the developer of the them, I've searched a lot of forums but found no answer to this. I'm desperate to get any help on this matter.
It looks like I solved the issue with the following codes:
/public_html/modules/ixtengine/js/cpanel/cpanel.min.js
... ,$.ajax({type:"POST",url:cpfuncurl+previewfun,data:{ ...
replaced by
... ,$.ajax({type:"PUT",url:cpfuncurl+previewfun,data:{ ...
and
... ,$.ajax({type:"POST",url:cpfuncurl+savefun,data:{ ...
replaced by
... ,$.ajax({type:"PUT",url:cpfuncurl+savefun,data:{ ...
/public_html/modules/ixtengine/cpanel/functions/upload.savepf.php and /public_html/modules/ixtengine/cpanel/functions/upload.previewwid.php
...
$theme = Tools::getValue('theme');
$conf = Tools::getValue('conf');
$skin = Tools::getValue('skin');
$skinid = Tools::getValue('skinid');
$token = Tools::getValue('token');
...
replaced by
...
$put_vars=array();
if($_SERVER['REQUEST_METHOD'] == 'PUT')
{
parse_str(file_get_contents("php://input"),$put_vars);
$theme = $put_vars['theme'];
$conf = $put_vars['conf'];
$skin = $put_vars['skin'];
$skinid = $put_vars['skinid'];
$token = $put_vars['token'];
}
else
{
$theme = Tools::getValue('theme');
$conf = Tools::getValue('conf');
$skin = Tools::getValue('skin');
$skinid = Tools::getValue('skinid');
$token = Tools::getValue('token');
}
...
This solution is particulary for the ixtengine module for some hosts where POST returns 403 error so I can't be sure if this method will work for someone else running into this problem, but it works for me.
so I do this
require 'net/http';
require 'net/smtp';
res = Net::HTTP.get_response(URI.parse("http://www.cifs.dk"));
and res.response.msg tells me 302 - the site has moved.
How do I get the full address that it was moved to? (http://www.cifs.dk/en)
res.methods shows me a bunch of things to try but no luck yet.
The closest I've found is
res.response.body, but that just gives me
... </h1>This object may be found here ...
which would be no fun at all to try to piece together.
The Location header is what you are looking for:
response['Location']
I am trying to use HTTP::get to download an image of a Google chart from a URL I created.
This was my first attempt:
failures_url = [title, type, data, size, colors, labels].join("&")
require 'net/http'
Net::HTTP.start("http://chart.googleapis.com") { |http|
resp = http.get("/chart?#{failures_url")
open("pie.png" ,"wb") { |file|
file.write(resp.body)
}
}
Which produced only an empty PNG file.
For my second attempt I used the value stored inside failure_url inside the http.get() call.
require 'net/http'
Net::HTTP.start("http://chart.googleapis.com") { |http|
resp = http.get("/chart?chtt=Builds+in+the+last+12+months&cht=bvg&chd=t:296,1058,1217,1615,1200,611,2055,1663,1746,1950,2044,2781,1553&chs=800x375&chco=4466AA&chxl=0:|Jul-2010|Aug-2010|Sep-2010|Oct-2010|Nov-2010|Dec-2010|Jan-2011|Feb-2011|Mar-2011|Apr-2011|May-2011|Jun-2011|Jul-2011|2:|Months|3:|Builds&chxt=x,y,x,y&chg=0,6.6666666666666666666666666666667,5,5,0,0&chxp=3,50|2,50&chbh=23,5,30&chxr=1,0,3000&chds=0,3000")
open("pie.png" ,"wb") { |file|
file.write(resp.body)
}
}
And, for some reason, this version works even though the first attempt had the same data inside the http.get() call. Does anyone know why this is?
SOLUTION:
After trying to figure why this is happening I found "How do I download a binary file over HTTP?".
One of the comments mentions removing http:// in the Net::HTTP.start(...) call otherwise it won't succeed. Sure enough after I did this:
failures_url = [title, type, data, size, colors, labels].join("&")
require 'net/http'
Net::HTTP.start("chart.googleapis.com") { |http|
resp = http.get("/chart?#{failures_url")
open("pie.png" ,"wb") { |file|
file.write(resp.body)
}
}
it worked.
I'd go after the file using Ruby's Open::URI:
require "open-uri"
File.open('pie.png', 'wb') do |fo|
fo.write open("http://chart.googleapis.com/chart?#{failures_url}").read
end
The reason I prefer Open::URI is it handles redirects automatically, so WHEN Google makes a change to their back-end and tries to redirect the URL, the code will handle it magically. It also handles timeouts and retries more gracefully if I remember right.
If you must have lower level control then I'd look at one of the many other HTTP clients for Ruby; Net::HTTP is fine for creating new services or when a client doesn't exist, but I'd use Open::URI or something besides Net::HTTP until the need presents itself.
The URL:
http://chart.googleapis.com/chart?chtt=Builds+in+the+last+12+months&cht=bvg&chd=t:296,1058,1217,1615,1200,611,2055,1663,1746,1950,2044,2781,1553&chs=800x375&chco=4466AA&chxl=0:|Jul-2010|Aug-2010|Sep-2010|Oct-2010|Nov-2010|Dec-2010|Jan-2011|Feb-2011|Mar-2011|Apr-2011|May-2011|Jun-2011|Jul-2011|2:|Months|3:|Builds&chxt=x,y,x,y&chg=0,6.6666666666666666666666666666667,5,5,0,0&chxp=3,50|2,50&chbh=23,5,30&chxr=1,0,3000&chds=0,3000
makes URI upset. I suspect it is seeing characters that should be encoded in URLs.
For documentation purposes, here is what URI says when trying to parse that URL as-is:
URI::InvalidURIError: bad URI(is not URI?)
If I encode the URI first, I get a successful parse. Testing further using Open::URI shows it is able to retrieve the document at that point and returns 23701 bytes.
I think that is the appropriate fix for the problem if some of those characters are truly not acceptable to URI AND they are out of the RFC.
Just for information, the Addressable::URI gem is a great replacement for the built-in URI.
resp = http.get("/chart?#{failures_url")
If you copied your original code then you're missing a closing curly bracket in your path string.
Your original version did not have the parameter name for each parameter, just the data. For example, on the title, you cannot just submit "Builds+in+the+last+12+months", but instead it must be "chtt=Builds+in+the+last+12+months".
Try this:
failures_url = ["title="+title, "type="+type, "data="+data, "size="+size, "colors="+colors, "labels="+labels].join("&")